Make CAuto classes use COldObject
parent
fdb594b9f7
commit
16883fcdc4
|
@ -20,26 +20,22 @@
|
|||
|
||||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
#include "app/app.h"
|
||||
|
||||
#include "common/event.h"
|
||||
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
#include "object/old_object.h"
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/gauge.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAuto::CAuto(CObject* object)
|
||||
CAuto::CAuto(COldObject* object)
|
||||
{
|
||||
m_object = object;
|
||||
m_engine = Gfx::CEngine::GetInstancePointer();
|
||||
|
|
|
@ -22,13 +22,16 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#include "common/event.h"
|
||||
#include "common/global.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#include "object/object_type.h"
|
||||
|
||||
|
||||
class CRobotMain;
|
||||
class CSoundInterface;
|
||||
class CLevelParserLine;
|
||||
class COldObject;
|
||||
|
||||
namespace Ui {
|
||||
class CInterface;
|
||||
|
@ -46,13 +49,14 @@ class CCloud;
|
|||
class CCamera;
|
||||
class CPlanet;
|
||||
class CLightning;
|
||||
class CTerrain;
|
||||
} /* Gfx */
|
||||
|
||||
|
||||
class CAuto
|
||||
{
|
||||
public:
|
||||
CAuto(CObject* object);
|
||||
CAuto(COldObject* object);
|
||||
virtual ~CAuto();
|
||||
|
||||
virtual void DeleteObject(bool bAll=false);
|
||||
|
@ -103,7 +107,7 @@ protected:
|
|||
Gfx::CCamera* m_camera;
|
||||
Ui::CInterface* m_interface;
|
||||
CRobotMain* m_main;
|
||||
CObject* m_object;
|
||||
COldObject* m_object;
|
||||
CSoundInterface* m_sound;
|
||||
|
||||
ObjectType m_type;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/robotmain.h"
|
||||
|
||||
#include "physics/physics.h"
|
||||
|
@ -54,7 +55,7 @@ const float BASE_TRANSIT_TIME = 15.0f; // transit duration
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoBase::CAutoBase(CObject* object) : CAuto(object)
|
||||
CAutoBase::CAutoBase(COldObject* object) : CAuto(object)
|
||||
{
|
||||
m_fogStart = m_engine->GetFogStart();
|
||||
m_deepView = m_engine->GetDeepView();
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#include "object/auto/auto.h"
|
||||
|
||||
#include "graphics/core/color.h"
|
||||
|
||||
|
||||
|
||||
enum AutoBaseParam
|
||||
|
@ -67,7 +69,7 @@ enum AutoBasePhase
|
|||
class CAutoBase : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoBase(CObject* object);
|
||||
CAutoBase(COldObject* object);
|
||||
~CAutoBase();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -79,8 +81,8 @@ public:
|
|||
Error GetError();
|
||||
|
||||
bool CreateInterface(bool bSelect);
|
||||
|
||||
Error TakeOff(bool printMsg);
|
||||
|
||||
Error TakeOff(bool printMsg);
|
||||
|
||||
protected:
|
||||
void UpdateInterface();
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
#include "object/interface/transportable_object.h"
|
||||
|
@ -30,13 +31,10 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoConvert::CAutoConvert(CObject* object) : CAuto(object)
|
||||
CAutoConvert::CAutoConvert(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = ACP_STOP;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoConvertPhase
|
||||
{
|
||||
|
@ -40,7 +41,7 @@ enum AutoConvertPhase
|
|||
class CAutoConvert : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoConvert(CObject* object);
|
||||
CAutoConvert(COldObject* object);
|
||||
~CAutoConvert();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -25,15 +25,13 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float DERRICK_DELAY = 10.0f; // duration of the extraction
|
||||
|
@ -44,7 +42,7 @@ const float DERRICK_DELAYu = 30.0f; // same, but for uranium
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoDerrick::CAutoDerrick(CObject* object) : CAuto(object)
|
||||
CAutoDerrick::CAutoDerrick(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = ADP_WAIT; // paused until the first Init ()
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoDerrickPhase
|
||||
{
|
||||
|
@ -40,7 +41,7 @@ enum AutoDerrickPhase
|
|||
class CAutoDerrick : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoDerrick(CObject* object);
|
||||
CAutoDerrick(COldObject* object);
|
||||
~CAutoDerrick();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -23,20 +23,18 @@
|
|||
#include "graphics/engine/pyro_manager.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoDestroyer::CAutoDestroyer(CObject* object) : CAuto(object)
|
||||
CAutoDestroyer::CAutoDestroyer(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = ADEP_WAIT; // paused until the first Init ()
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
|
||||
enum AutoDestroyerPhase
|
||||
{
|
||||
|
@ -39,7 +41,7 @@ enum AutoDestroyerPhase
|
|||
class CAutoDestroyer : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoDestroyer(CObject* object);
|
||||
CAutoDestroyer(COldObject* object);
|
||||
~CAutoDestroyer();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -26,23 +26,19 @@
|
|||
|
||||
#include "object/brain.h"
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/interface/programmable_object.h"
|
||||
#include "object/interface/transportable_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoEgg::CAutoEgg(CObject* object) : CAuto(object)
|
||||
CAutoEgg::CAutoEgg(COldObject* object) : CAuto(object)
|
||||
{
|
||||
m_type = OBJECT_NULL;
|
||||
m_value = 0.0f;
|
||||
m_string[0] = 0;
|
||||
|
||||
m_param = 0;
|
||||
m_phase = AEP_NULL;
|
||||
|
@ -138,11 +134,9 @@ bool CAutoEgg::SetValue(int rank, float value)
|
|||
return true;
|
||||
}
|
||||
|
||||
// Getes the string.
|
||||
|
||||
bool CAutoEgg::SetString(char *string)
|
||||
{
|
||||
strcpy(m_string, string);
|
||||
m_alienProgramName = string;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -189,7 +183,7 @@ bool CAutoEgg::EventProcess(const Event &event)
|
|||
CBrain* brain = dynamic_cast<CProgrammableObject*>(alien)->GetBrain();
|
||||
|
||||
Program* program = brain->AddProgram();
|
||||
brain->ReadProgram(program, m_string);
|
||||
brain->ReadProgram(program, m_alienProgramName.c_str());
|
||||
brain->RunProgram(program);
|
||||
}
|
||||
Init();
|
||||
|
@ -312,7 +306,7 @@ bool CAutoEgg::Write(CLevelParserLine* line)
|
|||
line->AddParam("aSpeed", CLevelParserParamUPtr{new CLevelParserParam(m_speed)});
|
||||
line->AddParam("aParamType", CLevelParserParamUPtr{new CLevelParserParam(m_type)});
|
||||
line->AddParam("aParamValue1", CLevelParserParamUPtr{new CLevelParserParam(m_value)});
|
||||
line->AddParam("aParamString", CLevelParserParamUPtr{new CLevelParserParam(std::string(m_string))});
|
||||
line->AddParam("aParamString", CLevelParserParamUPtr{new CLevelParserParam(m_alienProgramName)});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -329,7 +323,7 @@ bool CAutoEgg::Read(CLevelParserLine* line)
|
|||
m_speed = line->GetParam("aSpeed")->AsFloat(1.0f);
|
||||
m_type = line->GetParam("aParamType")->AsObjectType(OBJECT_NULL);
|
||||
m_value = line->GetParam("aParamValue1")->AsFloat(0.0f);
|
||||
strcpy(m_string, line->GetParam("aParamString")->AsString("").c_str());
|
||||
m_alienProgramName = line->GetParam("aParamString")->AsString("");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoEggPhase
|
||||
{
|
||||
AEP_NULL = 0,
|
||||
|
@ -39,23 +41,25 @@ enum AutoEggPhase
|
|||
class CAutoEgg : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoEgg(CObject* object);
|
||||
CAutoEgg(COldObject* object);
|
||||
~CAutoEgg();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
void DeleteObject(bool bAll=false) override;
|
||||
|
||||
void Init();
|
||||
void Start(int param);
|
||||
bool EventProcess(const Event &event);
|
||||
Error IsEnded();
|
||||
Error GetError();
|
||||
void Init() override;
|
||||
void Start(int param) override;
|
||||
bool EventProcess(const Event &event) override;
|
||||
Error IsEnded() override;
|
||||
Error GetError() override;
|
||||
|
||||
bool SetType(ObjectType type);
|
||||
bool SetValue(int rank, float value);
|
||||
bool SetString(char *string);
|
||||
bool SetType(ObjectType type) override;
|
||||
bool SetValue(int rank, float value) override;
|
||||
//! Sets program which will be run by created aliens
|
||||
// TODO: rename to be more meanigful
|
||||
bool SetString(char* string) override;
|
||||
|
||||
bool Write(CLevelParserLine* line);
|
||||
bool Read(CLevelParserLine* line);
|
||||
bool Write(CLevelParserLine* line) override;
|
||||
bool Read(CLevelParserLine* line) override;
|
||||
|
||||
protected:
|
||||
CObject* SearchAlien();
|
||||
|
@ -63,7 +67,7 @@ protected:
|
|||
protected:
|
||||
ObjectType m_type;
|
||||
float m_value;
|
||||
char m_string[100];
|
||||
std::string m_alienProgramName;
|
||||
int m_param;
|
||||
AutoEggPhase m_phase;
|
||||
float m_progress;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/brain.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/object_manager.h"
|
||||
#include "object/robotmain.h"
|
||||
#include "object/level/parserline.h"
|
||||
|
@ -39,14 +40,11 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoFactory::CAutoFactory(CObject* object) : CAuto(object)
|
||||
CAutoFactory::CAutoFactory(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_type = OBJECT_MOBILEws;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoFactoryPhase
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ enum AutoFactoryPhase
|
|||
class CAutoFactory : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoFactory(CObject* object);
|
||||
CAutoFactory(COldObject* object);
|
||||
~CAutoFactory();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -20,10 +20,11 @@
|
|||
|
||||
#include "object/auto/autoflag.h"
|
||||
|
||||
#include "math/geometry.h"
|
||||
#include "graphics/engine/terrain.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "math/geometry.h"
|
||||
|
||||
#include "object/old_object.h"
|
||||
|
||||
|
||||
|
||||
|
@ -39,7 +40,7 @@ static float g_flag3 = 2.00f;
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoFlag::CAutoFlag(CObject* object) : CAuto(object)
|
||||
CAutoFlag::CAutoFlag(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
class CAutoFlag : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoFlag(CObject* object);
|
||||
CAutoFlag(COldObject* object);
|
||||
~CAutoFlag();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
|
||||
#include "object/auto/autohouston.h"
|
||||
|
||||
#include "object/old_object.h"
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoHouston::CAutoHouston(CObject* object) : CAuto(object)
|
||||
CAutoHouston::CAutoHouston(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Math::Vector pos;
|
||||
int i;
|
||||
|
|
|
@ -44,7 +44,7 @@ const int HUSTONMAXLENS = 20;
|
|||
class CAutoHouston : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoHouston(CObject* object);
|
||||
CAutoHouston(COldObject* object);
|
||||
~CAutoHouston();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
|
||||
#include "object/auto/autojostle.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "object/old_object.h"
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoJostle::CAutoJostle(CObject* object) : CAuto(object)
|
||||
CAutoJostle::CAutoJostle(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
class CAutoJostle : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoJostle(CObject* object);
|
||||
CAutoJostle(COldObject* object);
|
||||
~CAutoJostle();
|
||||
|
||||
void DeleteObject(bool bAll=false) override;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/robotmain.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
@ -34,8 +35,6 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float LABO_DELAY = 20.0f; // duration of the analysis
|
||||
|
@ -45,11 +44,9 @@ const float LABO_DELAY = 20.0f; // duration of the analysis
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoLabo::CAutoLabo(CObject* object) : CAuto(object)
|
||||
CAutoLabo::CAutoLabo(COldObject* object) : CAuto(object)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i=0 ; i<3 ; i++ )
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
m_partiRank[i] = -1;
|
||||
}
|
||||
|
@ -59,7 +56,6 @@ CAutoLabo::CAutoLabo(CObject* object) : CAuto(object)
|
|||
Init();
|
||||
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -73,9 +69,7 @@ CAutoLabo::~CAutoLabo()
|
|||
|
||||
void CAutoLabo::DeleteObject(bool bAll)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i=0 ; i<3 ; i++ )
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if ( m_partiRank[i] != -1 )
|
||||
{
|
||||
|
@ -133,7 +127,7 @@ Error CAutoLabo::StartAction(int param)
|
|||
return ERR_LABO_ALREADY;
|
||||
}
|
||||
|
||||
CObject* power = m_poweredObject->GetPower();
|
||||
CObject* power = m_object->GetPower();
|
||||
if (power == nullptr)
|
||||
{
|
||||
return ERR_LABO_NULL;
|
||||
|
@ -305,7 +299,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power != 0 )
|
||||
{
|
||||
power->SetZoom(0, 1.0f-m_progress);
|
||||
|
@ -366,10 +360,10 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
m_eventQueue->AddEvent(newEvent);
|
||||
UpdateInterface();
|
||||
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power != nullptr )
|
||||
{
|
||||
m_poweredObject->SetPower(nullptr);
|
||||
m_object->SetPower(nullptr);
|
||||
CObjectManager::GetInstancePointer()->DeleteObject(power);
|
||||
}
|
||||
|
||||
|
@ -457,7 +451,7 @@ Error CAutoLabo::GetError()
|
|||
return ERR_BAT_VIRUS;
|
||||
}
|
||||
|
||||
CObject* obj = m_poweredObject->GetPower();
|
||||
CObject* obj = m_object->GetPower();
|
||||
if (obj == nullptr) return ERR_LABO_NULL;
|
||||
ObjectType type = obj->GetType();
|
||||
if ( type != OBJECT_BULLET ) return ERR_LABO_BAD;
|
||||
|
|
|
@ -44,7 +44,7 @@ enum AutoLaboPhase
|
|||
class CAutoLabo : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoLabo(CObject* object);
|
||||
CAutoLabo(COldObject* object);
|
||||
~CAutoLabo();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -67,7 +67,6 @@ protected:
|
|||
void SoundManip(float time, float amplitude, float frequency);
|
||||
|
||||
protected:
|
||||
CPoweredObject* m_poweredObject;
|
||||
AutoLaboPhase m_phase;
|
||||
float m_progress;
|
||||
float m_speed;
|
||||
|
|
|
@ -21,18 +21,15 @@
|
|||
#include "object/auto/automush.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoMush::CAutoMush(CObject* object) : CAuto(object)
|
||||
CAutoMush::CAutoMush(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ enum AutoMushPhase
|
|||
class CAutoMush : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoMush(CObject* object);
|
||||
CAutoMush(COldObject* object);
|
||||
~CAutoMush();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -23,17 +23,14 @@
|
|||
#include "graphics/engine/terrain.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoNest::CAutoNest(CObject* object) : CAuto(object)
|
||||
CAutoNest::CAutoNest(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoNestPhase
|
||||
{
|
||||
|
@ -37,7 +38,7 @@ enum AutoNestPhase
|
|||
class CAutoNest : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoNest(CObject* object);
|
||||
CAutoNest(COldObject* object);
|
||||
~CAutoNest();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
#include "object/interface/powered_object.h"
|
||||
|
@ -31,9 +32,6 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float NUCLEARPLANT_DELAY = 30.0f; // duration of the generation
|
||||
|
||||
|
@ -42,13 +40,12 @@ const float NUCLEARPLANT_DELAY = 30.0f; // duration of the generation
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoNuclearPlant::CAutoNuclearPlant(CObject* object) : CAuto(object)
|
||||
CAutoNuclearPlant::CAutoNuclearPlant(COldObject* object) : CAuto(object)
|
||||
{
|
||||
m_channelSound = -1;
|
||||
Init();
|
||||
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -234,7 +231,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
if ( cargo != nullptr )
|
||||
{
|
||||
CObjectManager::GetInstancePointer()->DeleteObject(cargo);
|
||||
m_poweredObject->SetPower(nullptr);
|
||||
m_object->SetPower(nullptr);
|
||||
}
|
||||
|
||||
CreatePower(); // creates the atomic cell
|
||||
|
@ -322,7 +319,7 @@ bool CAutoNuclearPlant::CreateInterface(bool bSelect)
|
|||
|
||||
CObject* CAutoNuclearPlant::SearchUranium()
|
||||
{
|
||||
CObject* obj = m_poweredObject->GetPower();
|
||||
CObject* obj = m_object->GetPower();
|
||||
if (obj == nullptr) return nullptr;
|
||||
if (obj->GetType() == OBJECT_URANIUM) return obj;
|
||||
return nullptr;
|
||||
|
@ -391,7 +388,7 @@ void CAutoNuclearPlant::CreatePower()
|
|||
|
||||
dynamic_cast<CTransportableObject*>(power)->SetTransporter(m_object);
|
||||
power->SetPosition(0, Math::Vector(22.0f, 3.0f, 0.0f));
|
||||
m_poweredObject->SetPower(power);
|
||||
m_object->SetPower(power);
|
||||
}
|
||||
|
||||
|
||||
|
@ -411,7 +408,7 @@ Error CAutoNuclearPlant::GetError()
|
|||
|
||||
//? if ( m_object->GetEnergy() < ENERGY_POWER ) return ERR_NUCLEAR_LOW;
|
||||
|
||||
CObject* obj = m_poweredObject->GetPower();
|
||||
CObject* obj = m_object->GetPower();
|
||||
if ( obj == nullptr ) return ERR_NUCLEAR_EMPTY;
|
||||
if ( obj->GetLock() ) return ERR_OK;
|
||||
ObjectType type = obj->GetType();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CPoweredObject;
|
||||
class CObject;
|
||||
|
||||
enum AutoNuclearPlantPhase
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ enum AutoNuclearPlantPhase
|
|||
class CAutoNuclearPlant : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoNuclearPlant(CObject* object);
|
||||
CAutoNuclearPlant(COldObject* object);
|
||||
~CAutoNuclearPlant();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -61,7 +61,6 @@ protected:
|
|||
void CreatePower();
|
||||
|
||||
protected:
|
||||
CPoweredObject* m_poweredObject;
|
||||
AutoNuclearPlantPhase m_phase;
|
||||
float m_progress;
|
||||
float m_speed;
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
|
||||
|
||||
#include "object/robotmain.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "object/old_object.h"
|
||||
|
||||
|
||||
const int PARAM_DEPOSE = 2; // run=2 -> deposits the spaceship
|
||||
|
@ -57,7 +55,7 @@ float Progress(float a, float b, float progress)
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoPortico::CAutoPortico(CObject* object) : CAuto(object)
|
||||
CAutoPortico::CAutoPortico(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = APOP_WAIT;
|
||||
|
@ -398,10 +396,7 @@ Error CAutoPortico::GetError()
|
|||
|
||||
void CAutoPortico::UpdateTrackMapping(float left, float right)
|
||||
{
|
||||
Gfx::Material mat;
|
||||
int rank;
|
||||
|
||||
memset( &mat, 0, sizeof(Gfx::Material));
|
||||
Gfx::Material mat;
|
||||
mat.diffuse.r = 1.0f;
|
||||
mat.diffuse.g = 1.0f;
|
||||
mat.diffuse.b = 1.0f; // blank
|
||||
|
@ -409,7 +404,7 @@ void CAutoPortico::UpdateTrackMapping(float left, float right)
|
|||
mat.ambient.g = 0.5f;
|
||||
mat.ambient.b = 0.5f;
|
||||
|
||||
rank = m_object->GetObjectRank(0);
|
||||
int rank = m_object->GetObjectRank(0);
|
||||
|
||||
m_engine->TrackTextureMapping(rank, mat, Gfx::ENG_RSTATE_PART1, "objects/lemt.png", "",
|
||||
Gfx::ENG_TEX_MAPPING_X,
|
||||
|
|
|
@ -42,7 +42,7 @@ enum AutoPorticoPhase
|
|||
class CAutoPortico : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoPortico(CObject* object);
|
||||
CAutoPortico(COldObject* object);
|
||||
~CAutoPortico();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
#include "object/interface/carrier_object.h"
|
||||
|
@ -33,14 +34,11 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoPowerCaptor::CAutoPowerCaptor(CObject* object) : CAuto(object)
|
||||
CAutoPowerCaptor::CAutoPowerCaptor(COldObject* object) : CAuto(object)
|
||||
{
|
||||
m_channelSound = -1;
|
||||
Init();
|
||||
|
|
|
@ -38,7 +38,7 @@ enum AutoPowerCaptorPhase
|
|||
class CAutoPowerCaptor : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoPowerCaptor(CObject* object);
|
||||
CAutoPowerCaptor(COldObject* object);
|
||||
~CAutoPowerCaptor();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/interface/powered_object.h"
|
||||
#include "object/interface/transportable_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
|
@ -34,9 +35,6 @@
|
|||
#include "ui/gauge.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float POWERPLANT_POWER = 0.4f; // Necessary energy for a battery
|
||||
const float POWERPLANT_DELAY = 12.0f; // processing time
|
||||
|
@ -46,13 +44,12 @@ const float POWERPLANT_DELAY = 12.0f; // processing time
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoPowerPlant::CAutoPowerPlant(CObject* object) : CAuto(object)
|
||||
CAutoPowerPlant::CAutoPowerPlant(COldObject* object) : CAuto(object)
|
||||
{
|
||||
m_partiSphere = -1;
|
||||
Init();
|
||||
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -313,7 +310,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
cargo = SearchMetal();
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
m_poweredObject->SetPower(nullptr);
|
||||
m_object->SetPower(nullptr);
|
||||
CObjectManager::GetInstancePointer()->DeleteObject(cargo);
|
||||
}
|
||||
|
||||
|
@ -326,7 +323,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
cargo->SetLock(false); // usable battery
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||
cargo->SetPosition(0, Math::Vector(0.0f, 3.0f, 0.0f));
|
||||
m_poweredObject->SetPower(cargo);
|
||||
m_object->SetPower(cargo);
|
||||
|
||||
m_main->DisplayError(INFO_ENERGY, m_object);
|
||||
}
|
||||
|
@ -380,7 +377,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
|
||||
CObject* CAutoPowerPlant::SearchMetal()
|
||||
{
|
||||
CObject* obj = m_poweredObject->GetPower();
|
||||
CObject* obj = m_object->GetPower();
|
||||
if ( obj == nullptr ) return nullptr;
|
||||
|
||||
ObjectType type = obj->GetType();
|
||||
|
@ -502,7 +499,7 @@ Error CAutoPowerPlant::GetError()
|
|||
|
||||
if ( m_object->GetEnergy() < POWERPLANT_POWER ) return ERR_ENERGY_LOW;
|
||||
|
||||
CObject* obj = m_poweredObject->GetPower();
|
||||
CObject* obj = m_object->GetPower();
|
||||
if (obj == nullptr) return ERR_ENERGY_EMPTY;
|
||||
ObjectType type = obj->GetType();
|
||||
if ( type == OBJECT_POWER ) return ERR_OK;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CPoweredObject;
|
||||
class CObject;
|
||||
|
||||
|
||||
enum AutoPowerPlantPhase
|
||||
|
@ -42,7 +42,7 @@ enum AutoPowerPlantPhase
|
|||
class CAutoPowerPlant : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoPowerPlant(CObject* object);
|
||||
CAutoPowerPlant(COldObject* object);
|
||||
~CAutoPowerPlant();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -65,7 +65,6 @@ protected:
|
|||
CObject* SearchPower();
|
||||
|
||||
protected:
|
||||
CPoweredObject* m_poweredObject;
|
||||
AutoPowerPlantPhase m_phase;
|
||||
float m_progress;
|
||||
float m_speed;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/interface/carrier_object.h"
|
||||
#include "object/interface/powered_object.h"
|
||||
|
||||
|
@ -33,12 +34,11 @@
|
|||
#include "ui/gauge.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoPowerStation::CAutoPowerStation(CObject* object) : CAuto(object)
|
||||
CAutoPowerStation::CAutoPowerStation(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -24,12 +24,13 @@
|
|||
|
||||
#include "object/auto/auto.h"
|
||||
|
||||
class CObject;
|
||||
|
||||
|
||||
class CAutoPowerStation : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoPowerStation(CObject* object);
|
||||
CAutoPowerStation(COldObject* object);
|
||||
~CAutoPowerStation();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -23,17 +23,17 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
#include "ui/gauge.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoRadar::CAutoRadar(CObject* object) : CAuto(object)
|
||||
CAutoRadar::CAutoRadar(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = ARAP_WAIT;
|
||||
|
|
|
@ -39,7 +39,7 @@ enum AutoRadarPhase
|
|||
class CAutoRadar : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoRadar(CObject* object);
|
||||
CAutoRadar(COldObject* object);
|
||||
~CAutoRadar();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -21,22 +21,20 @@
|
|||
#include "object/auto/autorepair.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
||||
#include "physics/physics.h"
|
||||
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoRepair::CAutoRepair(CObject* object) : CAuto(object)
|
||||
CAutoRepair::CAutoRepair(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
m_phase = ARP_WAIT; // paused until the first Init ()
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoRepairPhase
|
||||
{
|
||||
|
@ -40,7 +41,7 @@ enum AutoRepairPhase
|
|||
class CAutoRepair : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoRepair(CObject* object);
|
||||
CAutoRepair(COldObject* object);
|
||||
~CAutoRepair();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/robotmain.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
#include "object/interface/powered_object.h"
|
||||
|
@ -33,9 +34,6 @@
|
|||
#include "ui/gauge.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float SEARCH_TIME = 30.0f; // duration of a research
|
||||
|
||||
|
@ -43,7 +41,7 @@ const float SEARCH_TIME = 30.0f; // duration of a research
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoResearch::CAutoResearch(CObject* object) : CAuto(object)
|
||||
CAutoResearch::CAutoResearch(COldObject* object) : CAuto(object)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -54,7 +52,6 @@ CAutoResearch::CAutoResearch(CObject* object) : CAuto(object)
|
|||
Init();
|
||||
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -111,7 +108,7 @@ Error CAutoResearch::StartAction(int param)
|
|||
return ERR_RESEARCH_ALREADY;
|
||||
}
|
||||
|
||||
CObject* power = m_poweredObject->GetPower();
|
||||
CObject* power = m_object->GetPower();
|
||||
if (power == nullptr)
|
||||
{
|
||||
return ERR_RESEARCH_POWER;
|
||||
|
@ -218,7 +215,7 @@ bool CAutoResearch::EventProcess(const Event &event)
|
|||
FireStopUpdate(m_progress, true); // flashes
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power == 0 ) // more battery?
|
||||
{
|
||||
SetBusy(false);
|
||||
|
@ -300,7 +297,7 @@ Error CAutoResearch::GetError()
|
|||
return ERR_BAT_VIRUS;
|
||||
}
|
||||
|
||||
CObject* power = m_poweredObject->GetPower();
|
||||
CObject* power = m_object->GetPower();
|
||||
if ( power == 0 )
|
||||
{
|
||||
return ERR_RESEARCH_POWER;
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CPoweredObject;
|
||||
|
||||
enum AutoResearchPhase
|
||||
{
|
||||
ALP_WAIT = 1,
|
||||
|
@ -38,7 +36,7 @@ enum AutoResearchPhase
|
|||
class CAutoResearch : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoResearch(CObject* object);
|
||||
CAutoResearch(COldObject* object);
|
||||
~CAutoResearch();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -61,7 +59,6 @@ protected:
|
|||
void FireStopUpdate(float progress, bool bLightOn);
|
||||
|
||||
protected:
|
||||
CPoweredObject* m_poweredObject;
|
||||
AutoResearchPhase m_phase;
|
||||
float m_progress;
|
||||
float m_speed;
|
||||
|
|
|
@ -23,14 +23,15 @@
|
|||
#include "graphics/engine/particle.h"
|
||||
#include "graphics/engine/terrain.h"
|
||||
|
||||
#include "object/old_object.h"
|
||||
|
||||
#include "math/geometry.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoRoot::CAutoRoot(CObject* object) : CAuto(object)
|
||||
CAutoRoot::CAutoRoot(COldObject* object) : CAuto(object)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
class CAutoRoot : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoRoot(CObject* object);
|
||||
CAutoRoot(COldObject* object);
|
||||
~CAutoRoot();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
|
@ -23,20 +23,17 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
#include "object/interface/powered_object.h"
|
||||
|
||||
#include "physics/physics.h"
|
||||
|
||||
|
||||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
#include "ui/gauge.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float TOWER_SCOPE = 200.0f; // range of beam
|
||||
const float ENERGY_FIRE = 0.125f; // energy consumed by fire
|
||||
|
@ -44,7 +41,7 @@ const float ENERGY_FIRE = 0.125f; // energy consumed by fire
|
|||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoTower::CAutoTower(CObject* object) : CAuto(object)
|
||||
CAutoTower::CAutoTower(COldObject* object) : CAuto(object)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
@ -57,7 +54,6 @@ CAutoTower::CAutoTower(CObject* object) : CAuto(object)
|
|||
m_lastUpdateTime = 0.0f;
|
||||
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
m_poweredObject = dynamic_cast<CPoweredObject*>(m_object);
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -134,7 +130,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
if ( m_progress < 1.0f )
|
||||
{
|
||||
energy = 0.0f;
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power != 0 )
|
||||
{
|
||||
energy = power->GetEnergy()*power->GetCapacity();
|
||||
|
@ -174,7 +170,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
else
|
||||
{
|
||||
energy = 0.0f;
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power != 0 )
|
||||
{
|
||||
energy = power->GetEnergy()*power->GetCapacity();
|
||||
|
@ -227,7 +223,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
m_object->SetAngleY(1, m_angleYfinal);
|
||||
m_object->SetAngleZ(2, m_angleZfinal);
|
||||
|
||||
power = m_poweredObject->GetPower();
|
||||
power = m_object->GetPower();
|
||||
if ( power != 0 )
|
||||
{
|
||||
energy = power->GetEnergy();
|
||||
|
@ -321,7 +317,7 @@ Error CAutoTower::GetError()
|
|||
return ERR_BAT_VIRUS;
|
||||
}
|
||||
|
||||
CObject* power = m_poweredObject->GetPower();
|
||||
CObject* power = m_object->GetPower();
|
||||
if ( power == nullptr )
|
||||
{
|
||||
return ERR_TOWER_POWER; // no battery
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CPoweredObject;
|
||||
class CObject;
|
||||
|
||||
enum AutoTowerPhase
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ enum AutoTowerPhase
|
|||
class CAutoTower : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoTower(CObject* object);
|
||||
CAutoTower(COldObject* object);
|
||||
~CAutoTower();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
@ -62,7 +62,6 @@ protected:
|
|||
void FireStopUpdate(float progress, bool bLightOn);
|
||||
|
||||
protected:
|
||||
CPoweredObject* m_poweredObject;
|
||||
AutoTowerPhase m_phase;
|
||||
float m_progress;
|
||||
float m_speed;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "math/geometry.h"
|
||||
|
||||
#include "object/object_manager.h"
|
||||
#include "object/old_object.h"
|
||||
#include "object/robotmain.h"
|
||||
#include "object/level/parserline.h"
|
||||
#include "object/level/parserparam.h"
|
||||
|
@ -31,20 +32,15 @@
|
|||
#include "ui/interface.h"
|
||||
#include "ui/window.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
const float OPEN_DELAY = 8.0f; // duration of opening
|
||||
|
||||
|
||||
// Object's constructor.
|
||||
|
||||
CAutoVault::CAutoVault(CObject* object) : CAuto(object)
|
||||
CAutoVault::CAutoVault(COldObject* object) : CAuto(object)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i=0 ; i<4 ; i++ )
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
m_bKey[i] = false;
|
||||
m_keyParti[i] = -1;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "object/auto/auto.h"
|
||||
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoVaultPhase
|
||||
{
|
||||
|
@ -38,7 +39,7 @@ enum AutoVaultPhase
|
|||
class CAutoVault : public CAuto
|
||||
{
|
||||
public:
|
||||
CAutoVault(CObject* object);
|
||||
CAutoVault(COldObject* object);
|
||||
~CAutoVault();
|
||||
|
||||
void DeleteObject(bool bAll=false);
|
||||
|
|
Loading…
Reference in New Issue