Adds some in-progress gameObject recreation of various legacy game classes, such as PlayerObject, AIPlayerObject, Sound Emitter and Static Shape.

This commit is contained in:
Areloch 2019-03-04 21:44:00 -06:00
parent 775ca57047
commit 23182eb2a1
23 changed files with 792 additions and 35 deletions

View file

@ -0,0 +1,42 @@
#include "aiPlayerObject.h"
IMPLEMENT_CO_NETOBJECT_V1(AIPlayerObject);
AIPlayerObject::AIPlayerObject()
: mAIControllerComponent(nullptr)
{
}
AIPlayerObject::~AIPlayerObject()
{
}
bool AIPlayerObject::onAdd()
{
if (!Parent::onAdd())
return false;
//If we don't delinate from the template, just spawn as apropos here
if (!mDirtyGameObject)
{
//AI Controller
mAIControllerComponent = new AIControllerComponent();
if (!mAIControllerComponent->registerObject())
{
Con::errorf("PlayerObject::onAdd - unable to add mAIControllerComponent!");
return false;
}
mAIControllerComponent->setInternalName("aiControllerComponent");
addComponent(mAIControllerComponent);
}
return true;
}
void AIPlayerObject::onRemove()
{
Parent::onRemove();
}