The first error I get is "...\gameform.h(16) : error C2504: 'GameObject' : base class undefined"
Here's the base class in a file called "GameObject.h"
#ifndef _GameObject_h_
#define _GameObject_h_
#include "GameSpace.h"
class GameObject {
public:
GameSpace* GS;
GameObject ( GameSpace* in_GS = NULL ) : GS ( in_GS )
{
}
virtual GameObject& item() { return *this; }; // to be overridden
// item() will return a reference to the most derived version of itself
};
#endif
Here's "GameForm.h"
#ifndef _GameForm_h_
#define _GameForm_h_
#include "GameObject.h"
#include "DarkGDK.h"
#include "FulcrumPhy.h"
#include "TicketSystem.h"
#include "GameCore.h"
#include "GameState.h"
#include <map>
class GameForm : GameObject {
public:
int formid; // GDK id # for the actor / main mesh object
StateSpace States; // States table of the Form
GameEntity *ownerEntity; // Entity who owns this
// ************ CTOR & DTOR ***************
GameForm ( GameSpace* in_GS, GameEntity* in_ownerEntity ) : ownerEntity( in_ownerEntity )
: GameObject ( in_GS )
{ formid = GameCore::TS->getTicket("Form"); }
~GameForm () {
GameCore::TS->releaseTicket("Form", formid);
States.clearAll();
}
// ******** overrides ***********
virtual GameForm& item() { return *this; }
};
class ShipForm : GameForm {
// ************ CTOR & DTOR ***************
ShipForm ( GameSpace* in_GS, GameEntity* in_ownerEntity, std::string in_filename, int in_size, D3DXVECTOR3 in_rotation )
: GameForm( in_GS, in_ownerEntity )
{
// Creates a Ship by adding all the necessary States
States.addtoGameSpace (
new MeshGDK ( &States, formid, in_filename, in_size, in_rotation )
);
// States.addtoGameSpace ( new PositionFP() );
}
~ShipForm () {
// delete every state one by one
}
};
#endif












