GL - GetAllDynamicObjects , dennis order
This commit is contained in:
parent
7395a0a495
commit
06ddb86b17
|
@ -61,6 +61,8 @@ namespace GameLogic
|
|||
ObjectSpecialType GetObjectType() const override;
|
||||
int getNrOfDynamicObj()const override;
|
||||
IObjectData* GetObjectAt(int ID) const override;
|
||||
Utility::DynamicMemory::DynamicArray<IObjectData*> GetAllDynamicObjects() const override;
|
||||
|
||||
Level *level;
|
||||
};
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "GameLogicStates.h"
|
||||
#include <OysterMath.h>
|
||||
#include "LevelLoader\ObjectDefines.h"
|
||||
#include "DynamicArray.h"
|
||||
|
||||
|
||||
namespace GameLogic
|
||||
|
@ -107,6 +108,7 @@ namespace GameLogic
|
|||
public:
|
||||
virtual int getNrOfDynamicObj()const = 0;
|
||||
virtual IObjectData* GetObjectAt(int ID) const = 0;
|
||||
virtual Utility::DynamicMemory::DynamicArray<IObjectData*> GetAllDynamicObjects() const = 0;
|
||||
};
|
||||
|
||||
class DANBIAS_GAMELOGIC_DLL GameAPI
|
||||
|
|
|
@ -51,3 +51,15 @@ IObjectData* Game::LevelData::GetObjectAt(int ID) const
|
|||
{
|
||||
return this->level->GetObj(ID);
|
||||
}
|
||||
|
||||
Utility::DynamicMemory::DynamicArray<IObjectData*> Game::LevelData::GetAllDynamicObjects() const
|
||||
{
|
||||
Utility::DynamicMemory::DynamicArray<IObjectData*> objects(level->dynamicObjects.Size());
|
||||
|
||||
for(int i = 0; i < level->dynamicObjects.Size(); i++)
|
||||
{
|
||||
objects[i] = level->dynamicObjects[i];
|
||||
}
|
||||
|
||||
return objects;
|
||||
}
|
Loading…
Reference in New Issue