#pragma once

#define CLASS_STRUCTS_VERSION 1
#include "other.hpp"

//0 + 52 bytes
#define ClassStruct_SimObject \
	void* vftable; \
	const char* objectName; \
	SimObject* nextNameObject; \
	SimObject* nextManagerNameObject; \
	SimObject* nextIdObject; \
	void* mGroup; \
	unsigned int mFlags; \
	void* mNotifyList; \
	unsigned int id; /* +32 */ \
	Namespace* mNamespace; /* +36 */ \
	unsigned int mTypeMask; \
	void* SimObject_0[1]; \
	void* mFieldDictionary; \

struct SimObject
{
	ClassStruct_SimObject
};



//52 + 12 bytes
#define ClassStruct_SimSet \
	unsigned int mElementCount; /* +52 */ \
	unsigned int mArraySize; /* +56 */ \
	SimObject** mArray[]; /* +60 */ \

struct SimSet
{
	ClassStruct_SimObject
	ClassStruct_SimSet
};



//52 + 28 bytes
#define ClassStruct_NetObject \
	void* NetObject_0[4]; \
	void* SceneObject_netFlags; /* +68 */ \
	void* SceneObject_ghostID; /* +72 */ \
	void* NetObject_1[1]; \

struct NetObject
{
	ClassStruct_SimObject
	ClassStruct_NetObject
};



//80 + 408 bytes
#define ClassStruct_SceneObject \
	void* SceneObject_0[102]; \

struct SceneObject
{
	ClassStruct_SimObject
	ClassStruct_NetObject
	ClassStruct_SceneObject
};



//488 + 28 bytes
#define ClassStruct_GameBase \
	void* GameBase_0[7]; \

struct GameBase
{
	ClassStruct_SimObject
	ClassStruct_NetObject
	ClassStruct_SceneObject
	ClassStruct_GameBase
};



//516 + 1300 bytes
#define ClassStruct_ShapeBase \
	void* ShapeBase_0[325]; \

struct ShapeBase
{
	ClassStruct_SimObject
	ClassStruct_NetObject
	ClassStruct_SceneObject
	ClassStruct_GameBase
	ClassStruct_ShapeBase
};



//1816 + 780 bytes
#define ClassStruct_Player \
	void* Player_0[195]; \

struct Player
{
	ClassStruct_SimObject
	ClassStruct_NetObject
	ClassStruct_SceneObject
	ClassStruct_GameBase
	ClassStruct_ShapeBase
	ClassStruct_Player
};



//2596 + 140 bytes
#define ClassStruct_AIPlayer \
	void* AIPlayer_0[35]; \

struct AIPlayer
{
	ClassStruct_SimObject
	ClassStruct_NetObject
	ClassStruct_SceneObject
	ClassStruct_GameBase
	ClassStruct_ShapeBase
	ClassStruct_Player
	ClassStruct_AIPlayer
};



//52 + 28(?) bytes
#define ClassStruct_TCPObject \
	void* TCPObject_00; \
	void* TCPObject_01; \
	void* TCPObject_02; \
	void* TCPObject_03; \
	void* TCPObject_04; \
	void* TCPObject_05; \
	void* TCPObject_06; \

struct TCPobject
{
	ClassStruct_SimObject
	ClassStruct_TCPObject
};



//80 + ??
#define ClassStruct_SOCKobject \

struct SOCKobject
{
	ClassStruct_SimObject
	ClassStruct_TCPObject
	ClassStruct_SOCKobject
};



//80 + ??
#define ClassStruct_HTTPObject \

struct HTTPobject
{
	ClassStruct_SimObject
	ClassStruct_TCPObject
	ClassStruct_HTTPObject
};


int NamespaceClasses_instanceOf(SimObject* obj, const char* className)
{
	if(obj == NULL)
		return -1;

	Namespace* ns = obj->mNamespace;
	for(int i = 0; ns != NULL; i++)
	{
		//Look for names of real classes
		if(ns->mClassRep != NULL)
			if(strcmp(className, ns->mName) == 0)
				return 1;

		ns = ns->mParent;
	}

	return 0;
}

