i would like to fetch data by name, id(random object ID) or type.
c# has Dictionary.
but it should be pure c/c++ ... not something like Sqlite or anything dotnet.
pSysBuffer = new D3DCOLOR[ winSizeX * winSizeY ]; // 3rd directx buffer
// all my 2d stuf gets rendered here
struct WorldInventory
{
Gameobject gameobject;
// more properties
} worldinventory[ winSizeX * winSizeY ];
struct Gameobject
{
int[] x, y;
unsigned int id;
Wall* wall;
Enemy* enemy;
Bullit bullit;
Mine mine;
// more properties
} gameobject;
Is the GameObject struct a good design?
it can either be a wall, enemy, bullit or whatever and can span multiple x,y coordinates.
i donnot wanna use a vector, deque ... because it's changing pretty much every frame ...
how to keep a collection of GameObjects that's ever changing .... but it does not have to be double linked ... i gues.
my technique is pixel precise and not tile or math vector based.
i want to achieve ... something like ... a internal database for objects collission and or other things.
1 object ie: could query and ask if the coordinates are occupied and avoid looping the array.
this is keeping me busy for quite a while
thank you in advance