Make CTask classes use COldObject
parent
45302a3f4e
commit
3ed8980c46
|
@ -5157,8 +5157,9 @@ CObject* CRobotMain::IOReadScene(const char *filename, const char *filecbot)
|
||||||
if (cargo != nullptr)
|
if (cargo != nullptr)
|
||||||
{
|
{
|
||||||
assert(obj->Implements(ObjectInterfaceType::Carrier)); // TODO: exception?
|
assert(obj->Implements(ObjectInterfaceType::Carrier)); // TODO: exception?
|
||||||
|
assert(obj->Implements(ObjectInterfaceType::Old));
|
||||||
dynamic_cast<CCarrierObject*>(obj)->SetCargo(cargo);
|
dynamic_cast<CCarrierObject*>(obj)->SetCargo(cargo);
|
||||||
CTaskManip* task = new CTaskManip(obj);
|
CTaskManip* task = new CTaskManip(dynamic_cast<COldObject*>(obj));
|
||||||
task->Start(TMO_AUTO, TMA_GRAB); // holds the object!
|
task->Start(TMO_AUTO, TMA_GRAB); // holds the object!
|
||||||
delete task;
|
delete task;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
|
|
||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
|
|
||||||
#include "object/object.h"
|
#include "object/old_object.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/programmable_object.h"
|
#include "object/interface/programmable_object.h"
|
||||||
|
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTask::CTask(CObject* object)
|
CTask::CTask(COldObject* object)
|
||||||
{
|
{
|
||||||
m_sound = CApplication::GetInstancePointer()->GetSound();
|
m_sound = CApplication::GetInstancePointer()->GetSound();
|
||||||
m_engine = Gfx::CEngine::GetInstancePointer();
|
m_engine = Gfx::CEngine::GetInstancePointer();
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
class CBrain;
|
class CBrain;
|
||||||
class CPhysics;
|
class CPhysics;
|
||||||
class CMotion;
|
class CMotion;
|
||||||
class CObject;
|
class COldObject;
|
||||||
class CRobotMain;
|
class CRobotMain;
|
||||||
class CSoundInterface;
|
class CSoundInterface;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ const float ARM_STOCK_ANGLE3 = -70.0f*Math::PI/180.0f;
|
||||||
class CTask
|
class CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTask(CObject* object);
|
CTask(COldObject* object);
|
||||||
virtual ~CTask();
|
virtual ~CTask();
|
||||||
|
|
||||||
virtual bool EventProcess(const Event &event);
|
virtual bool EventProcess(const Event &event);
|
||||||
|
@ -82,7 +82,7 @@ protected:
|
||||||
CMotion* m_motion;
|
CMotion* m_motion;
|
||||||
CBrain* m_brain;
|
CBrain* m_brain;
|
||||||
CPhysics* m_physics;
|
CPhysics* m_physics;
|
||||||
CObject* m_object;
|
COldObject* m_object;
|
||||||
CRobotMain* m_main;
|
CRobotMain* m_main;
|
||||||
CSoundInterface* m_sound;
|
CSoundInterface* m_sound;
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskAdvance::CTaskAdvance(CObject* object) : CTask(object)
|
CTaskAdvance::CTaskAdvance(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
class CTaskAdvance : public CTask
|
class CTaskAdvance : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskAdvance(CObject* object);
|
CTaskAdvance(COldObject* object);
|
||||||
~CTaskAdvance();
|
~CTaskAdvance();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "object/auto/auto.h"
|
#include "object/auto/auto.h"
|
||||||
#include "object/motion/motionhuman.h"
|
#include "object/motion/motionhuman.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/carrier_object.h"
|
#include "object/interface/carrier_object.h"
|
||||||
#include "object/interface/transportable_object.h"
|
#include "object/interface/transportable_object.h"
|
||||||
|
@ -41,7 +42,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskBuild::CTaskBuild(CObject* object) : CTask(object)
|
CTaskBuild::CTaskBuild(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CObject;
|
||||||
|
|
||||||
const float BUILDMARGIN = 16.0f;
|
const float BUILDMARGIN = 16.0f;
|
||||||
const int TBMAXLIGHT = 4;
|
const int TBMAXLIGHT = 4;
|
||||||
|
@ -48,7 +49,7 @@ enum TaskBuildPhase
|
||||||
class CTaskBuild : public CTask
|
class CTaskBuild : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskBuild(CObject* object);
|
CTaskBuild(COldObject* object);
|
||||||
~CTaskBuild();
|
~CTaskBuild();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "graphics/engine/particle.h"
|
#include "graphics/engine/particle.h"
|
||||||
#include "graphics/engine/terrain.h"
|
#include "graphics/engine/terrain.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
|
||||||
CTaskDeleteMark::CTaskDeleteMark(CObject* object) : CTask(object)
|
CTaskDeleteMark::CTaskDeleteMark(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_bExecuted = false;
|
m_bExecuted = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskDeleteMark : public CTask
|
class CTaskDeleteMark : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskDeleteMark(CObject* object);
|
CTaskDeleteMark(COldObject* object);
|
||||||
~CTaskDeleteMark();
|
~CTaskDeleteMark();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
#include "object/interface/powered_object.h"
|
#include "object/old_object.h"
|
||||||
|
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
@ -37,9 +37,11 @@ const float ENERGY_FIREi = (0.10f/2.5f); // energy consumed/organic
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskFire::CTaskFire(CObject* object) : CTask(object)
|
CTaskFire::CTaskFire(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_soundChannel = -1;
|
m_soundChannel = -1;
|
||||||
|
|
||||||
|
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
@ -75,8 +77,7 @@ bool CTaskFire::EventProcess(const Event &event)
|
||||||
m_lastSound -= event.rTime;
|
m_lastSound -= event.rTime;
|
||||||
m_progress += event.rTime*m_speed;
|
m_progress += event.rTime*m_speed;
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
CObject* power = m_object->GetPower();
|
||||||
CObject* power = dynamic_cast<CPoweredObject*>(m_object)->GetPower();
|
|
||||||
if (power != nullptr)
|
if (power != nullptr)
|
||||||
{
|
{
|
||||||
energy = power->GetEnergy();
|
energy = power->GetEnergy();
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskFire : public CTask
|
class CTaskFire : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskFire(CObject* object);
|
CTaskFire(COldObject* object);
|
||||||
~CTaskFire();
|
~CTaskFire();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
#include "object/motion/motionant.h"
|
#include "object/motion/motionant.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
|
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskFireAnt::CTaskFireAnt(CObject* object) : CTask(object)
|
CTaskFireAnt::CTaskFireAnt(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_phase = TFA_NULL;
|
m_phase = TFA_NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ enum TaskFireAnt
|
||||||
class CTaskFireAnt : public CTask
|
class CTaskFireAnt : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskFireAnt(CObject* object);
|
CTaskFireAnt(COldObject* object);
|
||||||
~CTaskFireAnt();
|
~CTaskFireAnt();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "graphics/engine/pyro_manager.h"
|
#include "graphics/engine/pyro_manager.h"
|
||||||
#include "graphics/engine/water.h"
|
#include "graphics/engine/water.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/motion/motionhuman.h"
|
#include "object/motion/motionhuman.h"
|
||||||
#include "object/interface/carrier_object.h"
|
#include "object/interface/carrier_object.h"
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskFlag::CTaskFlag(CObject* object) : CTask(object)
|
CTaskFlag::CTaskFlag(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CObject;
|
||||||
|
|
||||||
enum TaskFlagOrder
|
enum TaskFlagOrder
|
||||||
{
|
{
|
||||||
|
@ -39,7 +40,7 @@ enum TaskFlagOrder
|
||||||
class CTaskFlag : public CTask
|
class CTaskFlag : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskFlag(CObject* object);
|
CTaskFlag(COldObject* object);
|
||||||
~CTaskFlag();
|
~CTaskFlag();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "object/task/taskgoto.h"
|
#include "object/task/taskgoto.h"
|
||||||
|
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
|
@ -29,6 +27,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/interface/transportable_object.h"
|
#include "object/interface/transportable_object.h"
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ const float SAFETY_MARGIN = 0.5f; // Smallest distance between two objects
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskGoto::CTaskGoto(CObject* object) : CTask(object)
|
CTaskGoto::CTaskGoto(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_bmArray = 0;
|
m_bmArray = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,11 @@
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CObject;
|
||||||
|
|
||||||
const int MAXPOINTS = 500;
|
const int MAXPOINTS = 500;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum TaskGotoGoal
|
enum TaskGotoGoal
|
||||||
{
|
{
|
||||||
TGG_DEFAULT = -1, // default mode
|
TGG_DEFAULT = -1, // default mode
|
||||||
|
@ -76,7 +76,7 @@ enum TaskGotoPhase
|
||||||
class CTaskGoto : public CTask
|
class CTaskGoto : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskGoto(CObject* object);
|
CTaskGoto(COldObject* object);
|
||||||
~CTaskGoto();
|
~CTaskGoto();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
|
|
||||||
#include "object/task/taskgungoal.h"
|
#include "object/task/taskgungoal.h"
|
||||||
|
|
||||||
#include "object/object.h"
|
#include "object/old_object.h"
|
||||||
|
|
||||||
#include "sound/sound.h"
|
#include "sound/sound.h"
|
||||||
|
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskGunGoal::CTaskGunGoal(CObject* object) : CTask(object)
|
CTaskGunGoal::CTaskGunGoal(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_aimImpossible = false;
|
m_aimImpossible = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskGunGoal : public CTask
|
class CTaskGunGoal : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskGunGoal(CObject* object);
|
CTaskGunGoal(COldObject* object);
|
||||||
~CTaskGunGoal();
|
~CTaskGunGoal();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskInfo::CTaskInfo(CObject* object) : CTask(object)
|
CTaskInfo::CTaskInfo(COldObject* object) : CTask(object)
|
||||||
, m_progress(0.0f)
|
, m_progress(0.0f)
|
||||||
, m_speed(0.0f)
|
, m_speed(0.0f)
|
||||||
, m_time(0.0f)
|
, m_time(0.0f)
|
||||||
|
|
|
@ -29,7 +29,7 @@ class CExchangePost;
|
||||||
class CTaskInfo : public CTask
|
class CTaskInfo : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskInfo(CObject* object);
|
CTaskInfo(COldObject* object);
|
||||||
~CTaskInfo();
|
~CTaskInfo();
|
||||||
|
|
||||||
bool EventProcess(const Event &event) override;
|
bool EventProcess(const Event &event) override;
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "object/task/taskmanager.h"
|
#include "object/task/taskmanager.h"
|
||||||
|
|
||||||
#include "object/task/taskwait.h"
|
#include "object/task/taskwait.h"
|
||||||
|
@ -39,12 +37,12 @@
|
||||||
#include "object/task/taskspiderexplo.h"
|
#include "object/task/taskspiderexplo.h"
|
||||||
#include "object/task/taskreset.h"
|
#include "object/task/taskreset.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
|
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskManager::CTaskManager(CObject* object)
|
CTaskManager::CTaskManager(COldObject* object)
|
||||||
{
|
{
|
||||||
m_task = nullptr;
|
m_task = nullptr;
|
||||||
m_object = object;
|
m_object = object;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
class CTaskManager
|
class CTaskManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskManager(CObject* object);
|
CTaskManager(COldObject* object);
|
||||||
~CTaskManager();
|
~CTaskManager();
|
||||||
|
|
||||||
Error StartTaskWait(float time);
|
Error StartTaskWait(float time);
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CTask* m_task;
|
CTask* m_task;
|
||||||
CObject* m_object;
|
COldObject* m_object;
|
||||||
bool m_bPilot;
|
bool m_bPilot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/carrier_object.h"
|
#include "object/interface/carrier_object.h"
|
||||||
|
@ -48,16 +49,13 @@ const float MARGIN_BEE = 5.0f; //OK 1.9
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskManip::CTaskManip(CObject* object) : CTask(object)
|
CTaskManip::CTaskManip(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_arm = TMA_NEUTRAL;
|
m_arm = TMA_NEUTRAL;
|
||||||
m_hand = TMH_OPEN;
|
m_hand = TMH_OPEN;
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Carrier));
|
assert(m_object->Implements(ObjectInterfaceType::Carrier));
|
||||||
m_carrierObject = dynamic_cast<CCarrierObject*>(m_object);
|
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
@ -316,7 +314,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
type = m_object->GetType();
|
type = m_object->GetType();
|
||||||
if ( type == OBJECT_BEE ) // bee?
|
if ( type == OBJECT_BEE ) // bee?
|
||||||
{
|
{
|
||||||
if (m_carrierObject->GetCargo() == nullptr)
|
if (m_object->GetCargo() == nullptr)
|
||||||
{
|
{
|
||||||
if ( !m_physics->GetLand() ) return ERR_MANIP_FLY;
|
if ( !m_physics->GetLand() ) return ERR_MANIP_FLY;
|
||||||
|
|
||||||
|
@ -324,17 +322,17 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
if (other == nullptr) return ERR_MANIP_NIL;
|
if (other == nullptr) return ERR_MANIP_NIL;
|
||||||
assert(other->Implements(ObjectInterfaceType::Transportable));
|
assert(other->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
m_carrierObject->SetCargo(other); // takes the ball
|
m_object->SetCargo(other); // takes the ball
|
||||||
dynamic_cast<CTransportableObject*>(other)->SetTransporter(m_object);
|
dynamic_cast<CTransportableObject*>(other)->SetTransporter(m_object);
|
||||||
dynamic_cast<CTransportableObject*>(other)->SetTransporterPart(0); // taken with the base
|
dynamic_cast<CTransportableObject*>(other)->SetTransporterPart(0); // taken with the base
|
||||||
other->SetPosition(0, Math::Vector(0.0f, -3.0f, 0.0f));
|
other->SetPosition(0, Math::Vector(0.0f, -3.0f, 0.0f));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
other = m_carrierObject->GetCargo(); // other = ball
|
other = m_object->GetCargo(); // other = ball
|
||||||
assert(other->Implements(ObjectInterfaceType::Transportable));
|
assert(other->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
m_carrierObject->SetCargo(nullptr); // lick the ball
|
m_object->SetCargo(nullptr); // lick the ball
|
||||||
dynamic_cast<CTransportableObject*>(other)->SetTransporter(nullptr);
|
dynamic_cast<CTransportableObject*>(other)->SetTransporter(nullptr);
|
||||||
pos = m_object->GetPosition();
|
pos = m_object->GetPosition();
|
||||||
pos.y -= 3.0f;
|
pos.y -= 3.0f;
|
||||||
|
@ -363,7 +361,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_energy = 0.0f;
|
m_energy = 0.0f;
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if ( power != 0 )
|
if ( power != 0 )
|
||||||
{
|
{
|
||||||
m_energy = power->GetEnergy();
|
m_energy = power->GetEnergy();
|
||||||
|
@ -387,7 +385,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
|
|
||||||
if ( order == TMO_AUTO )
|
if ( order == TMO_AUTO )
|
||||||
{
|
{
|
||||||
if (m_carrierObject->GetCargo() == nullptr)
|
if (m_object->GetCargo() == nullptr)
|
||||||
{
|
{
|
||||||
m_order = TMO_GRAB;
|
m_order = TMO_GRAB;
|
||||||
}
|
}
|
||||||
|
@ -401,11 +399,11 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
m_order = order;
|
m_order = order;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_order == TMO_GRAB && m_carrierObject->GetCargo() != nullptr)
|
if (m_order == TMO_GRAB && m_object->GetCargo() != nullptr)
|
||||||
{
|
{
|
||||||
return ERR_MANIP_BUSY;
|
return ERR_MANIP_BUSY;
|
||||||
}
|
}
|
||||||
if (m_order == TMO_DROP && m_carrierObject->GetCargo() == nullptr)
|
if (m_order == TMO_DROP && m_object->GetCargo() == nullptr)
|
||||||
{
|
{
|
||||||
return ERR_MANIP_EMPTY;
|
return ERR_MANIP_EMPTY;
|
||||||
}
|
}
|
||||||
|
@ -453,7 +451,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
}
|
}
|
||||||
if ( m_arm == TMA_POWER )
|
if ( m_arm == TMA_POWER )
|
||||||
{
|
{
|
||||||
if (m_poweredObject->GetPower() == nullptr) return ERR_MANIP_NIL;
|
if (m_object->GetPower() == nullptr) return ERR_MANIP_NIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +479,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
}
|
}
|
||||||
if ( m_arm == TMA_POWER )
|
if ( m_arm == TMA_POWER )
|
||||||
{
|
{
|
||||||
if (m_poweredObject->GetPower() != nullptr) return ERR_MANIP_OCC;
|
if (m_object->GetPower() != nullptr) return ERR_MANIP_OCC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +499,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
||||||
if ( m_timeLimit < 0.5f ) m_timeLimit = 0.5f;
|
if ( m_timeLimit < 0.5f ) m_timeLimit = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_carrierObject->GetCargo() == nullptr) // not carrying anything?
|
if (m_object->GetCargo() == nullptr) // not carrying anything?
|
||||||
{
|
{
|
||||||
m_hand = TMH_OPEN; // open clamp
|
m_hand = TMH_OPEN; // open clamp
|
||||||
}
|
}
|
||||||
|
@ -626,7 +624,7 @@ Error CTaskManip::IsEnded()
|
||||||
{
|
{
|
||||||
if ( m_bSubm ) m_speed = 1.0f/1.5f;
|
if ( m_bSubm ) m_speed = 1.0f/1.5f;
|
||||||
if ( !TransporterTakeObject() &&
|
if ( !TransporterTakeObject() &&
|
||||||
m_carrierObject->GetCargo() == nullptr)
|
m_object->GetCargo() == nullptr)
|
||||||
{
|
{
|
||||||
m_hand = TMH_OPEN; // reopens the clamp
|
m_hand = TMH_OPEN; // reopens the clamp
|
||||||
m_arm = TMA_NEUTRAL;
|
m_arm = TMA_NEUTRAL;
|
||||||
|
@ -655,7 +653,7 @@ Error CTaskManip::IsEnded()
|
||||||
if ( m_step == 1 )
|
if ( m_step == 1 )
|
||||||
{
|
{
|
||||||
if ( m_bSubm ) m_speed = 1.0f/0.7f;
|
if ( m_bSubm ) m_speed = 1.0f/0.7f;
|
||||||
cargo = m_carrierObject->GetCargo();
|
cargo = m_object->GetCargo();
|
||||||
if (TransporterDeposeObject())
|
if (TransporterDeposeObject())
|
||||||
{
|
{
|
||||||
if ( (m_arm == TMA_OTHER ||
|
if ( (m_arm == TMA_OTHER ||
|
||||||
|
@ -693,7 +691,7 @@ Error CTaskManip::IsEnded()
|
||||||
|
|
||||||
bool CTaskManip::Abort()
|
bool CTaskManip::Abort()
|
||||||
{
|
{
|
||||||
if (m_carrierObject->GetCargo() == nullptr) // not carrying anything?
|
if (m_object->GetCargo() == nullptr) // not carrying anything?
|
||||||
{
|
{
|
||||||
m_hand = TMH_OPEN; // open clamp
|
m_hand = TMH_OPEN; // open clamp
|
||||||
m_arm = TMA_NEUTRAL;
|
m_arm = TMA_NEUTRAL;
|
||||||
|
@ -1084,7 +1082,7 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
{
|
{
|
||||||
if (m_arm == TMA_GRAB) // takes immediately?
|
if (m_arm == TMA_GRAB) // takes immediately?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false; // nothing to take?
|
if (cargo == nullptr) return false; // nothing to take?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -1124,7 +1122,7 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
cargo->SetAngleY(0, 0.0f);
|
cargo->SetAngleY(0, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_FFRONT) // takes on the ground in front?
|
if (m_arm == TMA_FFRONT) // takes on the ground in front?
|
||||||
|
@ -1160,7 +1158,7 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
cargo->SetAngleY(0, 0.0f);
|
cargo->SetAngleY(0, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_FBACK) // takes on the ground behind?
|
if (m_arm == TMA_FBACK) // takes on the ground behind?
|
||||||
|
@ -1182,12 +1180,12 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||||
cargo->SetAngleY(0, 0.0f);
|
cargo->SetAngleY(0, 0.0f);
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_POWER) // takes battery in the back?
|
if (m_arm == TMA_POWER) // takes battery in the back?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_poweredObject->GetPower();
|
CObject* cargo = m_object->GetPower();
|
||||||
if (cargo == nullptr) return false; // no battery?
|
if (cargo == nullptr) return false; // no battery?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -1200,8 +1198,8 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
cargo->SetAngleY(0, 0.0f);
|
cargo->SetAngleY(0, 0.0f);
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
||||||
|
|
||||||
m_poweredObject->SetPower(nullptr);
|
m_object->SetPower(nullptr);
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_OTHER) // battery takes from friend?
|
if (m_arm == TMA_OTHER) // battery takes from friend?
|
||||||
|
@ -1228,7 +1226,7 @@ bool CTaskManip::TransporterTakeObject()
|
||||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||||
cargo->SetAngleY(0, 0.0f);
|
cargo->SetAngleY(0, 0.0f);
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1240,7 +1238,7 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
{
|
{
|
||||||
if (m_arm == TMA_FFRONT) // deposits on the ground in front?
|
if (m_arm == TMA_FFRONT) // deposits on the ground in front?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false; // nothing transported?
|
if (cargo == nullptr) return false; // nothing transported?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -1256,12 +1254,12 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
cargo->FloorAdjust(); // plate well on the ground
|
cargo->FloorAdjust(); // plate well on the ground
|
||||||
|
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
||||||
m_carrierObject->SetCargo(nullptr); // deposit
|
m_object->SetCargo(nullptr); // deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_FBACK) // deposited on the ground behind?
|
if (m_arm == TMA_FBACK) // deposited on the ground behind?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false; // nothing transported?
|
if (cargo == nullptr) return false; // nothing transported?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -1276,18 +1274,18 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
cargo->SetAngleZ(0, 0.0f);
|
cargo->SetAngleZ(0, 0.0f);
|
||||||
|
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
||||||
m_carrierObject->SetCargo(nullptr); // deposit
|
m_object->SetCargo(nullptr); // deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_POWER) // deposits battery in the back?
|
if (m_arm == TMA_POWER) // deposits battery in the back?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false; // nothing transported?
|
if (cargo == nullptr) return false; // nothing transported?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
m_cargoType = cargo->GetType();
|
m_cargoType = cargo->GetType();
|
||||||
|
|
||||||
if (m_poweredObject->GetPower() != nullptr) return false;
|
if (m_object->GetPower() != nullptr) return false;
|
||||||
|
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
||||||
|
@ -1298,8 +1296,8 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
cargo->SetAngleX(0, 0.0f);
|
cargo->SetAngleX(0, 0.0f);
|
||||||
cargo->SetAngleZ(0, 0.0f);
|
cargo->SetAngleZ(0, 0.0f);
|
||||||
|
|
||||||
m_poweredObject->SetPower(cargo); // uses
|
m_object->SetPower(cargo); // uses
|
||||||
m_carrierObject->SetCargo(nullptr);
|
m_object->SetCargo(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TMA_OTHER) // deposits battery on friend?
|
if (m_arm == TMA_OTHER) // deposits battery on friend?
|
||||||
|
@ -1314,7 +1312,7 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
CObject* cargo = dynamic_cast<CPoweredObject*>(other)->GetPower();
|
CObject* cargo = dynamic_cast<CPoweredObject*>(other)->GetPower();
|
||||||
if (cargo != nullptr) return false; // the other already has a battery?
|
if (cargo != nullptr) return false; // the other already has a battery?
|
||||||
|
|
||||||
cargo = m_carrierObject->GetCargo();
|
cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false;
|
if (cargo == nullptr) return false;
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -1330,7 +1328,7 @@ bool CTaskManip::TransporterDeposeObject()
|
||||||
cargo->SetAngleZ(0, 0.0f);
|
cargo->SetAngleZ(0, 0.0f);
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
||||||
|
|
||||||
m_carrierObject->SetCargo(nullptr); // deposit
|
m_object->SetCargo(nullptr); // deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CCarrierObject;
|
class CObject;
|
||||||
class CPoweredObject;
|
|
||||||
|
|
||||||
enum TaskManipOrder
|
enum TaskManipOrder
|
||||||
{
|
{
|
||||||
|
@ -60,7 +59,7 @@ enum TaskManipHand
|
||||||
class CTaskManip : public CTask
|
class CTaskManip : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskManip(CObject* object);
|
CTaskManip(COldObject* object);
|
||||||
~CTaskManip();
|
~CTaskManip();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
@ -81,8 +80,6 @@ protected:
|
||||||
void SoundManip(float time, float amplitude=1.0f, float frequency=1.0f);
|
void SoundManip(float time, float amplitude=1.0f, float frequency=1.0f);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CCarrierObject* m_carrierObject;
|
|
||||||
CPoweredObject* m_poweredObject;
|
|
||||||
TaskManipOrder m_order;
|
TaskManipOrder m_order;
|
||||||
TaskManipArm m_arm;
|
TaskManipArm m_arm;
|
||||||
TaskManipHand m_hand;
|
TaskManipHand m_hand;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "graphics/engine/particle.h"
|
#include "graphics/engine/particle.h"
|
||||||
|
|
||||||
#include "object/object.h"
|
#include "object/old_object.h"
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskPen::CTaskPen(CObject* object) : CTask(object)
|
CTaskPen::CTaskPen(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ enum TaskPenPhase
|
||||||
class CTaskPen : public CTask
|
class CTaskPen : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskPen(CObject* object);
|
CTaskPen(COldObject* object);
|
||||||
~CTaskPen();
|
~CTaskPen();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "object/task/taskrecover.h"
|
#include "object/task/taskrecover.h"
|
||||||
|
|
||||||
#include "graphics/engine/particle.h"
|
#include "graphics/engine/particle.h"
|
||||||
|
@ -28,6 +26,7 @@
|
||||||
|
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/powered_object.h"
|
#include "object/interface/powered_object.h"
|
||||||
|
@ -40,7 +39,7 @@ const float RECOVER_DIST = 11.8f;
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskRecover::CTaskRecover(CObject* object) : CTask(object)
|
CTaskRecover::CTaskRecover(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_ruin = 0;
|
m_ruin = 0;
|
||||||
m_soundChannel = -1;
|
m_soundChannel = -1;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
class CObject;
|
||||||
|
|
||||||
enum TaskRecoverPhase
|
enum TaskRecoverPhase
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ enum TaskRecoverPhase
|
||||||
class CTaskRecover : public CTask
|
class CTaskRecover : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskRecover(CObject* object);
|
CTaskRecover(COldObject* object);
|
||||||
~CTaskRecover();
|
~CTaskRecover();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "object/task/taskreset.h"
|
#include "object/task/taskreset.h"
|
||||||
|
|
||||||
#include "object/brain.h"
|
#include "object/brain.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/carrier_object.h"
|
#include "object/interface/carrier_object.h"
|
||||||
|
@ -37,7 +38,7 @@ const float RESET_DELAY_MOVE = 0.7f;
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskReset::CTaskReset(CObject* object) : CTask(object)
|
CTaskReset::CTaskReset(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "object/task/task.h"
|
#include "object/task/task.h"
|
||||||
|
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ enum TaskResetPhase
|
||||||
class CTaskReset : public CTask
|
class CTaskReset : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskReset(CObject* object);
|
CTaskReset(COldObject* object);
|
||||||
~CTaskReset();
|
~CTaskReset();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskSearch::CTaskSearch(CObject* object) : CTask(object)
|
CTaskSearch::CTaskSearch(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_hand = TSH_UP;
|
m_hand = TSH_UP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum TaskSearchPhase
|
||||||
class CTaskSearch : public CTask
|
class CTaskSearch : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskSearch(CObject* object);
|
CTaskSearch(COldObject* object);
|
||||||
~CTaskSearch();
|
~CTaskSearch();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
#include "object/brain.h"
|
#include "object/brain.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
#include "object/interface/powered_object.h"
|
#include "object/interface/powered_object.h"
|
||||||
|
@ -41,14 +42,13 @@ const float ENERGY_TIME = 20.0f; // maximum duration if full battery
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskShield::CTaskShield(CObject* object) : CTask(object)
|
CTaskShield::CTaskShield(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_rankSphere = -1;
|
m_rankSphere = -1;
|
||||||
m_soundChannel = -1;
|
m_soundChannel = -1;
|
||||||
m_effectLight = -1;
|
m_effectLight = -1;
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
@ -112,7 +112,7 @@ bool CTaskShield::EventProcess(const Event &event)
|
||||||
{
|
{
|
||||||
energy = (1.0f/ENERGY_TIME)*event.rTime;
|
energy = (1.0f/ENERGY_TIME)*event.rTime;
|
||||||
energy *= GetRadius()/RADIUS_SHIELD_MAX;
|
energy *= GetRadius()/RADIUS_SHIELD_MAX;
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if (power != nullptr)
|
if (power != nullptr)
|
||||||
{
|
{
|
||||||
power->SetEnergy(power->GetEnergy()-energy/power->GetCapacity());
|
power->SetEnergy(power->GetEnergy()-energy/power->GetCapacity());
|
||||||
|
@ -291,7 +291,7 @@ Error CTaskShield::Start(TaskShieldMode mode, float delay)
|
||||||
m_bError = true; // operation impossible
|
m_bError = true; // operation impossible
|
||||||
if ( !m_physics->GetLand() ) return ERR_SHIELD_VEH;
|
if ( !m_physics->GetLand() ) return ERR_SHIELD_VEH;
|
||||||
|
|
||||||
CObject* power = m_poweredObject->GetPower();
|
CObject* power = m_object->GetPower();
|
||||||
if (power == nullptr) return ERR_SHIELD_ENERGY;
|
if (power == nullptr) return ERR_SHIELD_ENERGY;
|
||||||
float energy = power->GetEnergy();
|
float energy = power->GetEnergy();
|
||||||
if ( energy == 0.0f ) return ERR_SHIELD_ENERGY;
|
if ( energy == 0.0f ) return ERR_SHIELD_ENERGY;
|
||||||
|
@ -380,7 +380,7 @@ Error CTaskShield::IsEnded()
|
||||||
{
|
{
|
||||||
m_object->SetShieldRadius(GetRadius());
|
m_object->SetShieldRadius(GetRadius());
|
||||||
|
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if ( power == 0 )
|
if ( power == 0 )
|
||||||
{
|
{
|
||||||
energy = 0.0f;
|
energy = 0.0f;
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
class CPoweredObject;
|
|
||||||
|
|
||||||
const float RADIUS_SHIELD_MIN = 40.0f; // minimum radius of the protected zone
|
const float RADIUS_SHIELD_MIN = 40.0f; // minimum radius of the protected zone
|
||||||
const float RADIUS_SHIELD_MAX = 100.0f; // maximum radius of the protected zone
|
const float RADIUS_SHIELD_MAX = 100.0f; // maximum radius of the protected zone
|
||||||
|
@ -55,7 +54,7 @@ enum TaskShieldMode
|
||||||
class CTaskShield : public CTask
|
class CTaskShield : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskShield(CObject* object);
|
CTaskShield(COldObject* object);
|
||||||
~CTaskShield();
|
~CTaskShield();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
@ -72,7 +71,6 @@ protected:
|
||||||
float GetRadius();
|
float GetRadius();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CPoweredObject* m_poweredObject;
|
|
||||||
TaskShieldPhase m_phase;
|
TaskShieldPhase m_phase;
|
||||||
float m_progress;
|
float m_progress;
|
||||||
float m_speed;
|
float m_speed;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "graphics/engine/pyro_manager.h"
|
#include "graphics/engine/pyro_manager.h"
|
||||||
|
|
||||||
#include "object/motion/motionspider.h"
|
#include "object/motion/motionspider.h"
|
||||||
|
#include "object/old_object.h"
|
||||||
|
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskSpiderExplo::CTaskSpiderExplo(CObject* object) : CTask(object)
|
CTaskSpiderExplo::CTaskSpiderExplo(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_time = 0.0f;
|
m_time = 0.0f;
|
||||||
m_bError = false;
|
m_bError = false;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskSpiderExplo : public CTask
|
class CTaskSpiderExplo : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskSpiderExplo(CObject* object);
|
CTaskSpiderExplo(COldObject* object);
|
||||||
~CTaskSpiderExplo();
|
~CTaskSpiderExplo();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/motion/motionhuman.h"
|
#include "object/motion/motionhuman.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
@ -39,15 +40,12 @@
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskTake::CTaskTake(CObject* object) : CTask(object)
|
CTaskTake::CTaskTake(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_arm = TTA_NEUTRAL;
|
m_arm = TTA_NEUTRAL;
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Carrier));
|
assert(m_object->Implements(ObjectInterfaceType::Carrier));
|
||||||
m_carrierObject = dynamic_cast<CCarrierObject*>(m_object);
|
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
@ -114,7 +112,7 @@ Error CTaskTake::Start()
|
||||||
|
|
||||||
m_physics->SetMotorSpeed(Math::Vector(0.0f, 0.0f, 0.0f));
|
m_physics->SetMotorSpeed(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||||
|
|
||||||
if (m_carrierObject->IsCarryingCargo())
|
if (m_object->IsCarryingCargo())
|
||||||
m_order = TTO_DEPOSE;
|
m_order = TTO_DEPOSE;
|
||||||
else
|
else
|
||||||
m_order = TTO_TAKE;
|
m_order = TTO_TAKE;
|
||||||
|
@ -259,7 +257,7 @@ Error CTaskTake::IsEnded()
|
||||||
{
|
{
|
||||||
if ( m_step == 1 )
|
if ( m_step == 1 )
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
TransporterDeposeObject();
|
TransporterDeposeObject();
|
||||||
if ( m_arm == TTA_FRIEND &&
|
if ( m_arm == TTA_FRIEND &&
|
||||||
(m_cargoType == OBJECT_POWER ||
|
(m_cargoType == OBJECT_POWER ||
|
||||||
|
@ -463,7 +461,7 @@ bool CTaskTake::TransporterTakeObject()
|
||||||
cargo->SetAngleX(0, 0.0f);
|
cargo->SetAngleX(0, 0.0f);
|
||||||
cargo->SetAngleZ(0, 0.8f);
|
cargo->SetAngleZ(0, 0.8f);
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_arm == TTA_FRIEND) // takes friend's battery?
|
if (m_arm == TTA_FRIEND) // takes friend's battery?
|
||||||
|
@ -489,7 +487,7 @@ bool CTaskTake::TransporterTakeObject()
|
||||||
cargo->SetAngleX(0, 0.0f);
|
cargo->SetAngleX(0, 0.0f);
|
||||||
cargo->SetAngleZ(0, 0.8f);
|
cargo->SetAngleZ(0, 0.8f);
|
||||||
|
|
||||||
m_carrierObject->SetCargo(cargo); // takes
|
m_object->SetCargo(cargo); // takes
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -501,7 +499,7 @@ bool CTaskTake::TransporterDeposeObject()
|
||||||
{
|
{
|
||||||
if ( m_arm == TTA_FFRONT ) // deposes on the ground in front?
|
if ( m_arm == TTA_FFRONT ) // deposes on the ground in front?
|
||||||
{
|
{
|
||||||
CObject* cargo = m_carrierObject->GetCargo();
|
CObject* cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false; // does nothing?
|
if (cargo == nullptr) return false; // does nothing?
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
|
|
||||||
|
@ -517,7 +515,7 @@ bool CTaskTake::TransporterDeposeObject()
|
||||||
cargo->FloorAdjust(); // plate well on the ground
|
cargo->FloorAdjust(); // plate well on the ground
|
||||||
|
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(nullptr);
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(nullptr);
|
||||||
m_carrierObject->SetCargo(nullptr); // deposit
|
m_object->SetCargo(nullptr); // deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_arm == TTA_FRIEND ) // deposes battery on friends?
|
if ( m_arm == TTA_FRIEND ) // deposes battery on friends?
|
||||||
|
@ -530,7 +528,7 @@ bool CTaskTake::TransporterDeposeObject()
|
||||||
CObject* cargo = dynamic_cast<CPoweredObject*>(other)->GetPower();
|
CObject* cargo = dynamic_cast<CPoweredObject*>(other)->GetPower();
|
||||||
if (cargo != nullptr) return false; // the other already has a battery?
|
if (cargo != nullptr) return false; // the other already has a battery?
|
||||||
|
|
||||||
cargo = m_carrierObject->GetCargo();
|
cargo = m_object->GetCargo();
|
||||||
if (cargo == nullptr) return false;
|
if (cargo == nullptr) return false;
|
||||||
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
assert(cargo->Implements(ObjectInterfaceType::Transportable));
|
||||||
m_cargoType = cargo->GetType();
|
m_cargoType = cargo->GetType();
|
||||||
|
@ -545,7 +543,7 @@ bool CTaskTake::TransporterDeposeObject()
|
||||||
cargo->SetAngleZ(0, 0.0f);
|
cargo->SetAngleZ(0, 0.0f);
|
||||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
||||||
|
|
||||||
m_carrierObject->SetCargo(nullptr); // deposit
|
m_object->SetCargo(nullptr); // deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -26,9 +26,7 @@
|
||||||
#include "object/object.h"
|
#include "object/object.h"
|
||||||
|
|
||||||
|
|
||||||
class CCarrierObject;
|
class CObject;
|
||||||
class CPoweredObject;
|
|
||||||
|
|
||||||
|
|
||||||
enum TaskTakeOrder
|
enum TaskTakeOrder
|
||||||
{
|
{
|
||||||
|
@ -48,7 +46,7 @@ enum TaskTakeArm
|
||||||
class CTaskTake : public CTask
|
class CTaskTake : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskTake(CObject* object);
|
CTaskTake(COldObject* object);
|
||||||
~CTaskTake();
|
~CTaskTake();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
@ -65,8 +63,6 @@ protected:
|
||||||
bool IsFreeDeposeObject(Math::Vector pos);
|
bool IsFreeDeposeObject(Math::Vector pos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CCarrierObject* m_carrierObject;
|
|
||||||
CPoweredObject* m_poweredObject;
|
|
||||||
TaskTakeOrder m_order;
|
TaskTakeOrder m_order;
|
||||||
TaskTakeArm m_arm;
|
TaskTakeArm m_arm;
|
||||||
int m_step;
|
int m_step;
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
* along with this program. If not, see http://gnu.org/licenses
|
* along with this program. If not, see http://gnu.org/licenses
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "object/task/taskterraform.h"
|
#include "object/task/taskterraform.h"
|
||||||
|
|
||||||
#include "graphics/engine/pyro_manager.h"
|
#include "graphics/engine/pyro_manager.h"
|
||||||
|
@ -28,6 +25,7 @@
|
||||||
|
|
||||||
#include "math/geometry.h"
|
#include "math/geometry.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/brain.h"
|
#include "object/brain.h"
|
||||||
#include "object/object_manager.h"
|
#include "object/object_manager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
@ -46,13 +44,12 @@ const float ACTION_RADIUS = 400.0f;
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskTerraform::CTaskTerraform(CObject* object) : CTask(object)
|
CTaskTerraform::CTaskTerraform(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
m_lastParticle = 0.0f;
|
m_lastParticle = 0.0f;
|
||||||
m_soundChannel = -1;
|
m_soundChannel = -1;
|
||||||
|
|
||||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||||
m_poweredObject = dynamic_cast<CPoweredObject*>(object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object's destructor.
|
// Object's destructor.
|
||||||
|
@ -95,7 +92,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
||||||
|
|
||||||
m_object->SetZoom(0, 1.0f+m_progress*0.2f);
|
m_object->SetZoom(0, 1.0f+m_progress*0.2f);
|
||||||
|
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if (power != nullptr)
|
if (power != nullptr)
|
||||||
{
|
{
|
||||||
power->SetZoom(0, 1.0f+m_progress*1.0f);
|
power->SetZoom(0, 1.0f+m_progress*1.0f);
|
||||||
|
@ -207,7 +204,7 @@ Error CTaskTerraform::Start()
|
||||||
type = m_object->GetType();
|
type = m_object->GetType();
|
||||||
if ( type != OBJECT_MOBILErt ) return ERR_TERRA_VEH;
|
if ( type != OBJECT_MOBILErt ) return ERR_TERRA_VEH;
|
||||||
|
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if ( power == 0 ) return ERR_TERRA_ENERGY;
|
if ( power == 0 ) return ERR_TERRA_ENERGY;
|
||||||
energy = power->GetEnergy();
|
energy = power->GetEnergy();
|
||||||
if ( energy < ENERGY_TERRA/power->GetCapacity()+0.05f ) return ERR_TERRA_ENERGY;
|
if ( energy < ENERGY_TERRA/power->GetCapacity()+0.05f ) return ERR_TERRA_ENERGY;
|
||||||
|
@ -263,7 +260,7 @@ Error CTaskTerraform::IsEnded()
|
||||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||||
m_object->SetZoom(0, 1.0f);
|
m_object->SetZoom(0, 1.0f);
|
||||||
|
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if (power != nullptr)
|
if (power != nullptr)
|
||||||
{
|
{
|
||||||
power->SetZoom(0, 1.0f);
|
power->SetZoom(0, 1.0f);
|
||||||
|
@ -329,7 +326,7 @@ bool CTaskTerraform::Abort()
|
||||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||||
m_object->SetZoom(0, 1.0f);
|
m_object->SetZoom(0, 1.0f);
|
||||||
|
|
||||||
power = m_poweredObject->GetPower();
|
power = m_object->GetPower();
|
||||||
if (power != nullptr)
|
if (power != nullptr)
|
||||||
{
|
{
|
||||||
power->SetZoom(0, 1.0f);
|
power->SetZoom(0, 1.0f);
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
|
|
||||||
|
|
||||||
class CPoweredObject;
|
|
||||||
|
|
||||||
enum TaskTerraPhase
|
enum TaskTerraPhase
|
||||||
{
|
{
|
||||||
TTP_CHARGE = 1, // charge of energy
|
TTP_CHARGE = 1, // charge of energy
|
||||||
|
@ -42,7 +40,7 @@ enum TaskTerraPhase
|
||||||
class CTaskTerraform : public CTask
|
class CTaskTerraform : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskTerraform(CObject* object);
|
CTaskTerraform(COldObject* object);
|
||||||
~CTaskTerraform();
|
~CTaskTerraform();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
@ -55,7 +53,6 @@ protected:
|
||||||
bool Terraform();
|
bool Terraform();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CPoweredObject* m_poweredObject;
|
|
||||||
TaskTerraPhase m_phase;
|
TaskTerraPhase m_phase;
|
||||||
float m_progress;
|
float m_progress;
|
||||||
float m_speed;
|
float m_speed;
|
||||||
|
|
|
@ -23,12 +23,13 @@
|
||||||
#include "graphics/engine/terrain.h"
|
#include "graphics/engine/terrain.h"
|
||||||
#include "physics/physics.h"
|
#include "physics/physics.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskTurn::CTaskTurn(CObject* object) : CTask(object)
|
CTaskTurn::CTaskTurn(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskTurn : public CTask
|
class CTaskTurn : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskTurn(CObject* object);
|
CTaskTurn(COldObject* object);
|
||||||
~CTaskTurn();
|
~CTaskTurn();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -22,9 +22,11 @@
|
||||||
|
|
||||||
#include "graphics/engine/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CTaskWait::CTaskWait(CObject* object) : CTask(object)
|
CTaskWait::CTaskWait(COldObject* object) : CTask(object)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CTaskWait : public CTask
|
class CTaskWait : public CTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTaskWait(CObject* object);
|
CTaskWait(COldObject* object);
|
||||||
~CTaskWait();
|
~CTaskWait();
|
||||||
|
|
||||||
bool EventProcess(const Event &event);
|
bool EventProcess(const Event &event);
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "graphics/engine/engine.h"
|
#include "graphics/engine/engine.h"
|
||||||
#include "graphics/engine/text.h"
|
#include "graphics/engine/text.h"
|
||||||
|
|
||||||
|
#include "object/old_object.h"
|
||||||
#include "object/task/taskmanager.h"
|
#include "object/task/taskmanager.h"
|
||||||
#include "object/robotmain.h"
|
#include "object/robotmain.h"
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ const int CBOT_IPF = 100; // CBOT: default number of instructions / frame
|
||||||
|
|
||||||
// Object's constructor.
|
// Object's constructor.
|
||||||
|
|
||||||
CScript::CScript(CObject* object, CTaskManager** secondaryTask)
|
CScript::CScript(COldObject* object, CTaskManager** secondaryTask)
|
||||||
{
|
{
|
||||||
m_engine = Gfx::CEngine::GetInstancePointer();
|
m_engine = Gfx::CEngine::GetInstancePointer();
|
||||||
m_main = CRobotMain::GetInstancePointer();
|
m_main = CRobotMain::GetInstancePointer();
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "CBot/CBotDll.h"
|
#include "CBot/CBotDll.h"
|
||||||
|
|
||||||
|
|
||||||
class CObject;
|
class COldObject;
|
||||||
class CTaskManager;
|
class CTaskManager;
|
||||||
class CRobotMain;
|
class CRobotMain;
|
||||||
class CPauseManager;
|
class CPauseManager;
|
||||||
|
@ -59,7 +59,7 @@ class CScript
|
||||||
{
|
{
|
||||||
friend class CScriptFunctions;
|
friend class CScriptFunctions;
|
||||||
public:
|
public:
|
||||||
CScript(CObject* object, CTaskManager** secondaryTask);
|
CScript(COldObject* object, CTaskManager** secondaryTask);
|
||||||
~CScript();
|
~CScript();
|
||||||
|
|
||||||
void PutScript(Ui::CEdit* edit, const char* name);
|
void PutScript(Ui::CEdit* edit, const char* name);
|
||||||
|
@ -108,7 +108,7 @@ protected:
|
||||||
Gfx::CWater* m_water;
|
Gfx::CWater* m_water;
|
||||||
CTaskManager* m_primaryTask;
|
CTaskManager* m_primaryTask;
|
||||||
CTaskManager** m_secondaryTask;
|
CTaskManager** m_secondaryTask;
|
||||||
CObject* m_object;
|
COldObject* m_object;
|
||||||
CPauseManager* m_pause;
|
CPauseManager* m_pause;
|
||||||
|
|
||||||
int m_ipf; // number of instructions/second
|
int m_ipf; // number of instructions/second
|
||||||
|
|
Loading…
Reference in New Issue