From ad08d50bea6ae1c1be6ffc38136ee4a6ec422317 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 10 Jul 2015 12:12:18 +0200 Subject: [PATCH] Renamed some CAuto and CMotion classes --- src/CMakeLists.txt | 16 +++--- src/graphics/engine/lightning.cpp | 4 +- .../auto/{autohuston.cpp => autohouston.cpp} | 20 ++++---- .../auto/{autohuston.h => autohouston.h} | 8 +-- .../{autonuclear.cpp => autonuclearplant.cpp} | 36 ++++++------- .../{autonuclear.h => autonuclearplant.h} | 12 ++--- .../{autopara.cpp => autopowercaptor.cpp} | 26 +++++----- .../auto/{autopara.h => autopowercaptor.h} | 12 ++--- .../{autoenergy.cpp => autopowerplant.cpp} | 50 +++++++++---------- .../auto/{autoenergy.h => autopowerplant.h} | 12 ++--- .../{autostation.cpp => autopowerstation.cpp} | 20 ++++---- .../{autostation.h => autopowerstation.h} | 8 +-- .../auto/{autosafe.cpp => autovault.cpp} | 32 ++++++------ src/object/auto/{autosafe.h => autovault.h} | 12 ++--- ...iondummy.cpp => motionlevelcontroller.cpp} | 12 ++--- ...{motiondummy.h => motionlevelcontroller.h} | 8 +-- .../{motionmother.cpp => motionqueen.cpp} | 16 +++--- .../motion/{motionmother.h => motionqueen.h} | 8 +-- src/object/object_factory.cpp | 32 ++++++------ 19 files changed, 172 insertions(+), 172 deletions(-) rename src/object/auto/{autohuston.cpp => autohouston.cpp} (94%) rename src/object/auto/{autohuston.h => autohouston.h} (93%) rename src/object/auto/{autonuclear.cpp => autonuclearplant.cpp} (92%) rename src/object/auto/{autonuclear.h => autonuclearplant.h} (89%) rename src/object/auto/{autopara.cpp => autopowercaptor.cpp} (91%) rename src/object/auto/{autopara.h => autopowercaptor.h} (89%) rename src/object/auto/{autoenergy.cpp => autopowerplant.cpp} (92%) rename src/object/auto/{autoenergy.h => autopowerplant.h} (90%) rename src/object/auto/{autostation.cpp => autopowerstation.cpp} (95%) rename src/object/auto/{autostation.h => autopowerstation.h} (92%) rename src/object/auto/{autosafe.cpp => autovault.cpp} (95%) rename src/object/auto/{autosafe.h => autovault.h} (92%) rename src/object/motion/{motiondummy.cpp => motionlevelcontroller.cpp} (87%) rename src/object/motion/{motiondummy.h => motionlevelcontroller.h} (87%) rename src/object/motion/{motionmother.cpp => motionqueen.cpp} (97%) rename src/object/motion/{motionmother.h => motionqueen.h} (93%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 77652503..4039813c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,23 +128,23 @@ set(BASE_SOURCES object/auto/autoderrick.cpp object/auto/autodestroyer.cpp object/auto/autoegg.cpp - object/auto/autoenergy.cpp + object/auto/autopowerplant.cpp object/auto/autofactory.cpp object/auto/autoflag.cpp - object/auto/autohuston.cpp + object/auto/autohouston.cpp object/auto/autojostle.cpp object/auto/autolabo.cpp object/auto/automush.cpp object/auto/autonest.cpp - object/auto/autonuclear.cpp - object/auto/autopara.cpp + object/auto/autonuclearplant.cpp + object/auto/autopowercaptor.cpp object/auto/autoportico.cpp object/auto/autoradar.cpp object/auto/autorepair.cpp object/auto/autoresearch.cpp object/auto/autoroot.cpp - object/auto/autosafe.cpp - object/auto/autostation.cpp + object/auto/autovault.cpp + object/auto/autopowerstation.cpp object/auto/autotower.cpp object/brain.cpp object/drive_type.cpp @@ -156,9 +156,9 @@ set(BASE_SOURCES object/motion/motion.cpp object/motion/motionant.cpp object/motion/motionbee.cpp - object/motion/motiondummy.cpp + object/motion/motionlevelcontroller.cpp object/motion/motionhuman.cpp - object/motion/motionmother.cpp + object/motion/motionqueen.cpp object/motion/motionspider.cpp object/motion/motiontoto.cpp object/motion/motionvehicle.cpp diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp index 4e81e301..07042823 100644 --- a/src/graphics/engine/lightning.cpp +++ b/src/graphics/engine/lightning.cpp @@ -34,7 +34,7 @@ #include "object/object_manager.h" #include "object/robotmain.h" -#include "object/auto/autopara.h" +#include "object/auto/autopowercaptor.h" // Graphics module namespace @@ -110,7 +110,7 @@ bool CLightning::EventFrame(const Event &event) } else if (type == OBJECT_PARA) { - CAutoPara* automat = static_cast(obj->GetAuto()); + CAutoPowerCaptor* automat = static_cast(obj->GetAuto()); if (automat != nullptr) automat->StartLightning(); diff --git a/src/object/auto/autohuston.cpp b/src/object/auto/autohouston.cpp similarity index 94% rename from src/object/auto/autohuston.cpp rename to src/object/auto/autohouston.cpp index 864919e4..5a5f45c9 100644 --- a/src/object/auto/autohuston.cpp +++ b/src/object/auto/autohouston.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autohuston.h" +#include "object/auto/autohouston.h" #include "ui/interface.h" #include "ui/window.h" @@ -28,7 +28,7 @@ // Object's constructor. -CAutoHuston::CAutoHuston(CObject* object) : CAuto(object) +CAutoHouston::CAutoHouston(CObject* object) : CAuto(object) { Math::Vector pos; int i; @@ -169,14 +169,14 @@ CAutoHuston::CAutoHuston(CObject* object) : CAuto(object) // Object's destructor. -CAutoHuston::~CAutoHuston() +CAutoHouston::~CAutoHouston() { } // Destroys the object. -void CAutoHuston::DeleteObject(bool bAll) +void CAutoHouston::DeleteObject(bool bAll) { CAuto::DeleteObject(bAll); } @@ -184,7 +184,7 @@ void CAutoHuston::DeleteObject(bool bAll) // Initialize the object. -void CAutoHuston::Init() +void CAutoHouston::Init() { m_time = 0.0f; @@ -195,14 +195,14 @@ void CAutoHuston::Init() // Start the object. -void CAutoHuston::Start(int param) +void CAutoHouston::Start(int param) { } // Management of an event. -bool CAutoHuston::EventProcess(const Event &event) +bool CAutoHouston::EventProcess(const Event &event) { Math::Vector speed; Math::Point dim; @@ -251,7 +251,7 @@ bool CAutoHuston::EventProcess(const Event &event) // Stops the controller. -bool CAutoHuston::Abort() +bool CAutoHouston::Abort() { return true; } @@ -259,7 +259,7 @@ bool CAutoHuston::Abort() // Creates all the interface when the object is selected. -bool CAutoHuston::CreateInterface(bool bSelect) +bool CAutoHouston::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -289,7 +289,7 @@ bool CAutoHuston::CreateInterface(bool bSelect) // Returns an error due to state of the automation. -Error CAutoHuston::GetError() +Error CAutoHouston::GetError() { return ERR_OK; } diff --git a/src/object/auto/autohuston.h b/src/object/auto/autohouston.h similarity index 93% rename from src/object/auto/autohuston.h rename to src/object/auto/autohouston.h index d3f561c8..627e616c 100644 --- a/src/object/auto/autohuston.h +++ b/src/object/auto/autohouston.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autohuston.h +// autohouston.h #pragma once @@ -41,11 +41,11 @@ struct HustonLens const int HUSTONMAXLENS = 20; -class CAutoHuston : public CAuto +class CAutoHouston : public CAuto { public: - CAutoHuston(CObject* object); - ~CAutoHuston(); + CAutoHouston(CObject* object); + ~CAutoHouston(); void DeleteObject(bool bAll=false); diff --git a/src/object/auto/autonuclear.cpp b/src/object/auto/autonuclearplant.cpp similarity index 92% rename from src/object/auto/autonuclear.cpp rename to src/object/auto/autonuclearplant.cpp index f06eb3e0..a716dfc9 100644 --- a/src/object/auto/autonuclear.cpp +++ b/src/object/auto/autonuclearplant.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autonuclear.h" +#include "object/auto/autonuclearplant.h" #include "math/geometry.h" @@ -34,14 +34,14 @@ #include -const float NUCLEAR_DELAY = 30.0f; // duration of the generation +const float NUCLEARPLANT_DELAY = 30.0f; // duration of the generation // Object's constructor. -CAutoNuclear::CAutoNuclear(CObject* object) : CAuto(object) +CAutoNuclearPlant::CAutoNuclearPlant(CObject* object) : CAuto(object) { m_channelSound = -1; Init(); @@ -49,14 +49,14 @@ CAutoNuclear::CAutoNuclear(CObject* object) : CAuto(object) // Object's destructor. -CAutoNuclear::~CAutoNuclear() +CAutoNuclearPlant::~CAutoNuclearPlant() { } // Destroys the object. -void CAutoNuclear::DeleteObject(bool all) +void CAutoNuclearPlant::DeleteObject(bool all) { if ( !all ) { @@ -80,7 +80,7 @@ void CAutoNuclear::DeleteObject(bool all) // Initialize the object. -void CAutoNuclear::Init() +void CAutoNuclearPlant::Init() { Math::Matrix* mat; @@ -101,7 +101,7 @@ void CAutoNuclear::Init() // Management of an event. -bool CAutoNuclear::EventProcess(const Event &event) +bool CAutoNuclearPlant::EventProcess(const Event &event) { CObject* cargo; Math::Matrix* mat; @@ -145,7 +145,7 @@ bool CAutoNuclear::EventProcess(const Event &event) cargo->SetLock(true); // usable uranium SetBusy(true); - InitProgressTotal(1.5f+NUCLEAR_DELAY+1.5f); + InitProgressTotal(1.5f+NUCLEARPLANT_DELAY+1.5f); UpdateInterface(); m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.4f); @@ -187,12 +187,12 @@ bool CAutoNuclear::EventProcess(const Event &event) m_sound->Play(SOUND_CLOSE, m_object->GetPosition(0), 1.0f, 1.0f); m_channelSound = m_sound->Play(SOUND_NUCLEAR, m_object->GetPosition(0), 1.0f, 0.1f, true); - m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, NUCLEAR_DELAY-1.0f, SOPER_CONTINUE); + m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, NUCLEARPLANT_DELAY-1.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP); m_phase = ANUP_GENERATE; m_progress = 0.0f; - m_speed = 1.0f/NUCLEAR_DELAY; + m_speed = 1.0f/NUCLEARPLANT_DELAY; } } @@ -286,7 +286,7 @@ bool CAutoNuclear::EventProcess(const Event &event) // Creates all the interface when the object is selected. -bool CAutoNuclear::CreateInterface(bool bSelect) +bool CAutoNuclearPlant::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -316,7 +316,7 @@ bool CAutoNuclear::CreateInterface(bool bSelect) // Seeking the uranium. -CObject* CAutoNuclear::SearchUranium() +CObject* CAutoNuclearPlant::SearchUranium() { CObject* pObj; @@ -328,7 +328,7 @@ CObject* CAutoNuclear::SearchUranium() // Seeks if a vehicle is too close. -bool CAutoNuclear::SearchVehicle() +bool CAutoNuclearPlant::SearchVehicle() { for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects()) { @@ -379,7 +379,7 @@ bool CAutoNuclear::SearchVehicle() // Creates an object stack. -void CAutoNuclear::CreatePower() +void CAutoNuclearPlant::CreatePower() { Math::Vector pos = m_object->GetPosition(0); float angle = m_object->GetAngleY(0); @@ -395,7 +395,7 @@ void CAutoNuclear::CreatePower() // Returns an error due the state of the automation. -Error CAutoNuclear::GetError() +Error CAutoNuclearPlant::GetError() { CObject* pObj; ObjectType type; @@ -424,7 +424,7 @@ Error CAutoNuclear::GetError() // Saves all parameters of the controller. -bool CAutoNuclear::Write(CLevelParserLine* line) +bool CAutoNuclearPlant::Write(CLevelParserLine* line) { if ( m_phase == ANUP_STOP || m_phase == ANUP_WAIT ) return false; @@ -440,12 +440,12 @@ bool CAutoNuclear::Write(CLevelParserLine* line) // Restores all parameters of the controller. -bool CAutoNuclear::Read(CLevelParserLine* line) +bool CAutoNuclearPlant::Read(CLevelParserLine* line) { if ( !line->GetParam("aExist")->AsBool(false) ) return false; CAuto::Read(line); - m_phase = static_cast< AutoNuclearPhase >(line->GetParam("aPhase")->AsInt(ANUP_WAIT)); + m_phase = static_cast< AutoNuclearPlantPhase >(line->GetParam("aPhase")->AsInt(ANUP_WAIT)); m_progress = line->GetParam("aProgress")->AsFloat(0.0f); m_speed = line->GetParam("aSpeed")->AsFloat(1.0f); diff --git a/src/object/auto/autonuclear.h b/src/object/auto/autonuclearplant.h similarity index 89% rename from src/object/auto/autonuclear.h rename to src/object/auto/autonuclearplant.h index e21ecc20..d0837e0b 100644 --- a/src/object/auto/autonuclear.h +++ b/src/object/auto/autonuclearplant.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autonuclear.h +// autonuclearplant.h #pragma once @@ -26,7 +26,7 @@ -enum AutoNuclearPhase +enum AutoNuclearPlantPhase { ANUP_STOP = 1, ANUP_WAIT = 2, @@ -37,11 +37,11 @@ enum AutoNuclearPhase -class CAutoNuclear : public CAuto +class CAutoNuclearPlant : public CAuto { public: - CAutoNuclear(CObject* object); - ~CAutoNuclear(); + CAutoNuclearPlant(CObject* object); + ~CAutoNuclearPlant(); void DeleteObject(bool bAll=false); @@ -60,7 +60,7 @@ protected: void CreatePower(); protected: - AutoNuclearPhase m_phase; + AutoNuclearPlantPhase m_phase; float m_progress; float m_speed; float m_timeVirus; diff --git a/src/object/auto/autopara.cpp b/src/object/auto/autopowercaptor.cpp similarity index 91% rename from src/object/auto/autopara.cpp rename to src/object/auto/autopowercaptor.cpp index 647c525e..a9fed670 100644 --- a/src/object/auto/autopara.cpp +++ b/src/object/auto/autopowercaptor.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autopara.h" +#include "object/auto/autopowercaptor.h" #include "math/geometry.h" @@ -38,7 +38,7 @@ // Object's constructor. -CAutoPara::CAutoPara(CObject* object) : CAuto(object) +CAutoPowerCaptor::CAutoPowerCaptor(CObject* object) : CAuto(object) { m_channelSound = -1; Init(); @@ -46,14 +46,14 @@ CAutoPara::CAutoPara(CObject* object) : CAuto(object) // Object's destructor. -CAutoPara::~CAutoPara() +CAutoPowerCaptor::~CAutoPowerCaptor() { } // Destroys the object. -void CAutoPara::DeleteObject(bool bAll) +void CAutoPowerCaptor::DeleteObject(bool bAll) { if ( m_channelSound != -1 ) { @@ -68,7 +68,7 @@ void CAutoPara::DeleteObject(bool bAll) // Initialize the object. -void CAutoPara::Init() +void CAutoPowerCaptor::Init() { Math::Matrix* mat; @@ -89,7 +89,7 @@ void CAutoPara::Init() // Reception of lightning. -void CAutoPara::StartLightning() +void CAutoPowerCaptor::StartLightning() { m_phase = APAP_LIGHTNING; m_progress = 0.0f; @@ -99,7 +99,7 @@ void CAutoPara::StartLightning() // Management of an event. -bool CAutoPara::EventProcess(const Event &event) +bool CAutoPowerCaptor::EventProcess(const Event &event) { Math::Vector pos, speed; Math::Point dim; @@ -192,7 +192,7 @@ bool CAutoPara::EventProcess(const Event &event) // Creates all the interface when the object is selected. -bool CAutoPara::CreateInterface(bool bSelect) +bool CAutoPowerCaptor::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -228,7 +228,7 @@ bool CAutoPara::CreateInterface(bool bSelect) // Returns an error due the state of the automation. -Error CAutoPara::GetError() +Error CAutoPowerCaptor::GetError() { if ( m_object->GetVirusMode() ) { @@ -240,7 +240,7 @@ Error CAutoPara::GetError() // Load all objects under the lightning rod. -void CAutoPara::ChargeObject(float rTime) +void CAutoPowerCaptor::ChargeObject(float rTime) { Math::Vector sPos = m_object->GetPosition(0); @@ -281,7 +281,7 @@ void CAutoPara::ChargeObject(float rTime) // Saves all parameters of the controller. -bool CAutoPara::Write(CLevelParserLine* line) +bool CAutoPowerCaptor::Write(CLevelParserLine* line) { if ( m_phase == APAP_WAIT ) return false; @@ -296,12 +296,12 @@ bool CAutoPara::Write(CLevelParserLine* line) // Restores all parameters of the controller. -bool CAutoPara::Read(CLevelParserLine* line) +bool CAutoPowerCaptor::Read(CLevelParserLine* line) { if ( !line->GetParam("aExist")->AsBool(false) ) return false; CAuto::Read(line); - m_phase = static_cast< AutoParaPhase >(line->GetParam("aPhase")->AsInt(APAP_WAIT)); + m_phase = static_cast< AutoPowerCaptorPhase >(line->GetParam("aPhase")->AsInt(APAP_WAIT)); m_progress = line->GetParam("aProgress")->AsFloat(0.0f); m_speed = line->GetParam("aSpeed")->AsFloat(1.0f); diff --git a/src/object/auto/autopara.h b/src/object/auto/autopowercaptor.h similarity index 89% rename from src/object/auto/autopara.h rename to src/object/auto/autopowercaptor.h index ec2c9722..91ec2aed 100644 --- a/src/object/auto/autopara.h +++ b/src/object/auto/autopowercaptor.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autopara.h +// autopowercaptor.h #pragma once @@ -26,7 +26,7 @@ -enum AutoParaPhase +enum AutoPowerCaptorPhase { APAP_WAIT = 1, APAP_LIGHTNING = 2, @@ -35,11 +35,11 @@ enum AutoParaPhase -class CAutoPara : public CAuto +class CAutoPowerCaptor : public CAuto { public: - CAutoPara(CObject* object); - ~CAutoPara(); + CAutoPowerCaptor(CObject* object); + ~CAutoPowerCaptor(); void DeleteObject(bool bAll=false); @@ -57,7 +57,7 @@ protected: void ChargeObject(float rTime); protected: - AutoParaPhase m_phase; + AutoPowerCaptorPhase m_phase; float m_progress; float m_speed; float m_timeVirus; diff --git a/src/object/auto/autoenergy.cpp b/src/object/auto/autopowerplant.cpp similarity index 92% rename from src/object/auto/autoenergy.cpp rename to src/object/auto/autopowerplant.cpp index 84fb5d98..a42a5ead 100644 --- a/src/object/auto/autoenergy.cpp +++ b/src/object/auto/autopowerplant.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autoenergy.h" +#include "object/auto/autopowerplant.h" #include "graphics/engine/terrain.h" @@ -37,15 +37,15 @@ #include -const float ENERGY_POWER = 0.4f; // Necessary energy for a battery -const float ENERGY_DELAY = 12.0f; // processing time +const float POWERPLANT_POWER = 0.4f; // Necessary energy for a battery +const float POWERPLANT_DELAY = 12.0f; // processing time // Object's constructor. -CAutoEnergy::CAutoEnergy(CObject* object) : CAuto(object) +CAutoPowerPlant::CAutoPowerPlant(CObject* object) : CAuto(object) { m_partiSphere = -1; Init(); @@ -53,14 +53,14 @@ CAutoEnergy::CAutoEnergy(CObject* object) : CAuto(object) // Object's destructor. -CAutoEnergy::~CAutoEnergy() +CAutoPowerPlant::~CAutoPowerPlant() { } // Destroys the object. -void CAutoEnergy::DeleteObject(bool all) +void CAutoPowerPlant::DeleteObject(bool all) { if ( m_partiSphere != -1 ) { @@ -89,7 +89,7 @@ void CAutoEnergy::DeleteObject(bool all) // Initialize the object. -void CAutoEnergy::Init() +void CAutoPowerPlant::Init() { m_time = 0.0f; m_timeVirus = 0.0f; @@ -106,7 +106,7 @@ void CAutoEnergy::Init() // Management of an event. -bool CAutoEnergy::EventProcess(const Event &event) +bool CAutoPowerPlant::EventProcess(const Event &event) { CObject* cargo; Math::Vector pos, ppos, speed; @@ -166,7 +166,7 @@ bool CAutoEnergy::EventProcess(const Event &event) { if ( cargo->GetType() == OBJECT_METAL ) { - if ( big > ENERGY_POWER ) bGO = true; + if ( big > POWERPLANT_POWER ) bGO = true; } else { @@ -183,7 +183,7 @@ bool CAutoEnergy::EventProcess(const Event &event) } SetBusy(true); - InitProgressTotal(ENERGY_DELAY); + InitProgressTotal(POWERPLANT_DELAY); CAuto::UpdateInterface(); pos = m_object->GetPosition(0); @@ -191,11 +191,11 @@ bool CAutoEnergy::EventProcess(const Event &event) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 3.0f; dim.y = dim.x; - m_partiSphere = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE1, ENERGY_DELAY, 0.0f, 0.0f); + m_partiSphere = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE1, POWERPLANT_DELAY, 0.0f, 0.0f); m_phase = AENP_CREATE; m_progress = 0.0f; - m_speed = 1.0f/ENERGY_DELAY; + m_speed = 1.0f/POWERPLANT_DELAY; } else { @@ -249,11 +249,11 @@ bool CAutoEnergy::EventProcess(const Event &event) { if ( cargo->GetType() == OBJECT_METAL ) { - big -= event.rTime/ENERGY_DELAY*ENERGY_POWER; + big -= event.rTime/POWERPLANT_DELAY*POWERPLANT_POWER; } else { - big += event.rTime/ENERGY_DELAY*0.25f; + big += event.rTime/POWERPLANT_DELAY*0.25f; } cargo->SetZoom(0, 1.0f-m_progress); } @@ -372,7 +372,7 @@ bool CAutoEnergy::EventProcess(const Event &event) // Seeking the metal object. -CObject* CAutoEnergy::SearchMetal() +CObject* CAutoPowerPlant::SearchMetal() { CObject* pObj; ObjectType type; @@ -391,7 +391,7 @@ CObject* CAutoEnergy::SearchMetal() // Search if a vehicle is too close. -bool CAutoEnergy::SearchVehicle() +bool CAutoPowerPlant::SearchVehicle() { Math::Vector cPos = m_object->GetPosition(0); @@ -444,7 +444,7 @@ bool CAutoEnergy::SearchVehicle() // Create a cell. -void CAutoEnergy::CreatePower() +void CAutoPowerPlant::CreatePower() { Math::Vector pos = m_object->GetPosition(0); float angle = m_object->GetAngleY(0); @@ -459,7 +459,7 @@ void CAutoEnergy::CreatePower() // Seeking the battery during manufacture. -CObject* CAutoEnergy::SearchPower() +CObject* CAutoPowerPlant::SearchPower() { Math::Vector cPos = m_object->GetPosition(0); @@ -484,7 +484,7 @@ CObject* CAutoEnergy::SearchPower() // Returns an error due the state of the automation. -Error CAutoEnergy::GetError() +Error CAutoPowerPlant::GetError() { CObject* pObj; ObjectType type; @@ -501,7 +501,7 @@ Error CAutoEnergy::GetError() res = m_terrain->GetResource(m_object->GetPosition(0)); if ( res != Gfx::TR_POWER ) return ERR_ENERGY_NULL; - if ( m_object->GetEnergy() < ENERGY_POWER ) return ERR_ENERGY_LOW; + if ( m_object->GetEnergy() < POWERPLANT_POWER ) return ERR_ENERGY_LOW; pObj = m_object->GetPower(); if ( pObj == 0 ) return ERR_ENERGY_EMPTY; @@ -518,7 +518,7 @@ Error CAutoEnergy::GetError() // Creates all the interface when the object is selected. -bool CAutoEnergy::CreateInterface(bool bSelect) +bool CAutoPowerPlant::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -554,7 +554,7 @@ bool CAutoEnergy::CreateInterface(bool bSelect) // Updates the state of all buttons on the interface, // following the time that elapses ... -void CAutoEnergy::UpdateInterface(float rTime) +void CAutoPowerPlant::UpdateInterface(float rTime) { Ui::CWindow* pw; Ui::CGauge* pg; @@ -579,7 +579,7 @@ void CAutoEnergy::UpdateInterface(float rTime) // Saves all parameters of the controller. -bool CAutoEnergy::Write(CLevelParserLine* line) +bool CAutoPowerPlant::Write(CLevelParserLine* line) { if ( m_phase == AENP_STOP || m_phase == AENP_WAIT ) return false; @@ -595,12 +595,12 @@ bool CAutoEnergy::Write(CLevelParserLine* line) // Restores all parameters of the controller. -bool CAutoEnergy::Read(CLevelParserLine* line) +bool CAutoPowerPlant::Read(CLevelParserLine* line) { if ( !line->GetParam("aExist")->AsBool(false) ) return false; CAuto::Read(line); - m_phase = static_cast< AutoEnergyPhase >(line->GetParam("aPhase")->AsInt(AENP_WAIT)); + m_phase = static_cast< AutoPowerPlantPhase >(line->GetParam("aPhase")->AsInt(AENP_WAIT)); m_progress = line->GetParam("aProgress")->AsFloat(0.0f); m_speed = line->GetParam("aSpeed")->AsFloat(1.0f); diff --git a/src/object/auto/autoenergy.h b/src/object/auto/autopowerplant.h similarity index 90% rename from src/object/auto/autoenergy.h rename to src/object/auto/autopowerplant.h index ec3cce12..3d8f3e20 100644 --- a/src/object/auto/autoenergy.h +++ b/src/object/auto/autopowerplant.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autoenergy.h +// autopowerplant.h #pragma once @@ -26,7 +26,7 @@ -enum AutoEnergyPhase +enum AutoPowerPlantPhase { AENP_STOP = 1, AENP_WAIT = 2, @@ -37,11 +37,11 @@ enum AutoEnergyPhase -class CAutoEnergy : public CAuto +class CAutoPowerPlant : public CAuto { public: - CAutoEnergy(CObject* object); - ~CAutoEnergy(); + CAutoPowerPlant(CObject* object); + ~CAutoPowerPlant(); void DeleteObject(bool bAll=false); @@ -63,7 +63,7 @@ protected: CObject* SearchPower(); protected: - AutoEnergyPhase m_phase; + AutoPowerPlantPhase m_phase; float m_progress; float m_speed; float m_timeVirus; diff --git a/src/object/auto/autostation.cpp b/src/object/auto/autopowerstation.cpp similarity index 95% rename from src/object/auto/autostation.cpp rename to src/object/auto/autopowerstation.cpp index 5222bc8b..01a5a856 100644 --- a/src/object/auto/autostation.cpp +++ b/src/object/auto/autopowerstation.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autostation.h" +#include "object/auto/autopowerstation.h" #include "graphics/engine/particle.h" #include "graphics/engine/terrain.h" @@ -36,21 +36,21 @@ // Object's constructor. -CAutoStation::CAutoStation(CObject* object) : CAuto(object) +CAutoPowerStation::CAutoPowerStation(CObject* object) : CAuto(object) { Init(); } // Object's destructor. -CAutoStation::~CAutoStation() +CAutoPowerStation::~CAutoPowerStation() { } // Destroys the object. -void CAutoStation::DeleteObject(bool bAll) +void CAutoPowerStation::DeleteObject(bool bAll) { if ( m_soundChannel != -1 ) { @@ -64,7 +64,7 @@ void CAutoStation::DeleteObject(bool bAll) // Initialize the object. -void CAutoStation::Init() +void CAutoPowerStation::Init() { m_time = 0.0f; m_timeVirus = 0.0f; @@ -79,7 +79,7 @@ void CAutoStation::Init() // Management of an event. -bool CAutoStation::EventProcess(const Event &event) +bool CAutoPowerStation::EventProcess(const Event &event) { Math::Matrix* mat; Math::Vector pos, ppos, speed; @@ -239,7 +239,7 @@ bool CAutoStation::EventProcess(const Event &event) // Seeking the vehicle on the station. -CObject* CAutoStation::SearchVehicle() +CObject* CAutoPowerStation::SearchVehicle() { Math::Vector sPos = m_object->GetPosition(0); @@ -285,7 +285,7 @@ CObject* CAutoStation::SearchVehicle() // Returns an error due the state of the automation. -Error CAutoStation::GetError() +Error CAutoPowerStation::GetError() { Gfx::TerrainRes res; @@ -303,7 +303,7 @@ Error CAutoStation::GetError() // Crée toute l'interface lorsque l'objet est sélectionné . -bool CAutoStation::CreateInterface(bool bSelect) +bool CAutoPowerStation::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -339,7 +339,7 @@ bool CAutoStation::CreateInterface(bool bSelect) // Updates the state of all buttons on the interface, // following the time that elapses ... -void CAutoStation::UpdateInterface(float rTime) +void CAutoPowerStation::UpdateInterface(float rTime) { Ui::CWindow* pw; Ui::CGauge* pg; diff --git a/src/object/auto/autostation.h b/src/object/auto/autopowerstation.h similarity index 92% rename from src/object/auto/autostation.h rename to src/object/auto/autopowerstation.h index ee082797..c7991d75 100644 --- a/src/object/auto/autostation.h +++ b/src/object/auto/autopowerstation.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autostation.h +// autopowerstation.h #pragma once @@ -26,11 +26,11 @@ -class CAutoStation : public CAuto +class CAutoPowerStation : public CAuto { public: - CAutoStation(CObject* object); - ~CAutoStation(); + CAutoPowerStation(CObject* object); + ~CAutoPowerStation(); void DeleteObject(bool bAll=false); diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autovault.cpp similarity index 95% rename from src/object/auto/autosafe.cpp rename to src/object/auto/autovault.cpp index ca5b29fd..f9bdd38c 100644 --- a/src/object/auto/autosafe.cpp +++ b/src/object/auto/autovault.cpp @@ -18,7 +18,7 @@ */ -#include "object/auto/autosafe.h" +#include "object/auto/autovault.h" #include "math/geometry.h" @@ -40,7 +40,7 @@ const float OPEN_DELAY = 8.0f; // duration of opening // Object's constructor. -CAutoSafe::CAutoSafe(CObject* object) : CAuto(object) +CAutoVault::CAutoVault(CObject* object) : CAuto(object) { int i; @@ -58,14 +58,14 @@ CAutoSafe::CAutoSafe(CObject* object) : CAuto(object) // Object's destructor. -CAutoSafe::~CAutoSafe() +CAutoVault::~CAutoVault() { } // Destroys the object. -void CAutoSafe::DeleteObject(bool bAll) +void CAutoVault::DeleteObject(bool bAll) { CObject* obj = SearchVehicle(); if ( obj != nullptr ) @@ -86,7 +86,7 @@ void CAutoSafe::DeleteObject(bool bAll) // Initialize the object. -void CAutoSafe::Init() +void CAutoVault::Init() { m_time = 0.0f; m_timeVirus = 0.0f; @@ -106,7 +106,7 @@ void CAutoSafe::Init() // Management of an event. -bool CAutoSafe::EventProcess(const Event &event) +bool CAutoVault::EventProcess(const Event &event) { CObject* pObj; Math::Vector pos, speed; @@ -308,7 +308,7 @@ bool CAutoSafe::EventProcess(const Event &event) // Creates all the interface when the object is selected. -bool CAutoSafe::CreateInterface(bool bSelect) +bool CAutoVault::CreateInterface(bool bSelect) { Ui::CWindow* pw; Math::Point pos, ddim; @@ -338,7 +338,7 @@ bool CAutoSafe::CreateInterface(bool bSelect) // Returns an error due the state of the automation. -Error CAutoSafe::GetError() +Error CAutoVault::GetError() { if ( m_object->GetVirusMode() ) { @@ -350,7 +350,7 @@ Error CAutoSafe::GetError() // Saves all parameters of the controller. -bool CAutoSafe::Write(CLevelParserLine* line) +bool CAutoVault::Write(CLevelParserLine* line) { if ( m_phase == ASAP_WAIT ) return false; @@ -365,12 +365,12 @@ bool CAutoSafe::Write(CLevelParserLine* line) // Restores all parameters of the controller. -bool CAutoSafe::Read(CLevelParserLine* line) +bool CAutoVault::Read(CLevelParserLine* line) { if ( !line->GetParam("aExist")->AsBool(false) ) return false; CAuto::Read(line); - m_phase = static_cast< AutoSafePhase >(line->GetParam("aPhase")->AsInt(ASAP_WAIT)); + m_phase = static_cast< AutoVaultPhase >(line->GetParam("aPhase")->AsInt(ASAP_WAIT)); m_progress = line->GetParam("aProgress")->AsFloat(0.0f); m_speed = line->GetParam("aSpeed")->AsFloat(1.0f); @@ -382,7 +382,7 @@ bool CAutoSafe::Read(CLevelParserLine* line) // Counts the number of keys -int CAutoSafe::CountKeys() +int CAutoVault::CountKeys() { Math::Vector cPos = m_object->GetPosition(0); float cAngle = m_object->GetAngleY(0); @@ -460,7 +460,7 @@ int CAutoSafe::CountKeys() // Blocks all keys. -void CAutoSafe::LockKeys() +void CAutoVault::LockKeys() { Math::Vector cPos = m_object->GetPosition(0); @@ -484,7 +484,7 @@ void CAutoSafe::LockKeys() // Sent down all the keys. -void CAutoSafe::DownKeys(float progress) +void CAutoVault::DownKeys(float progress) { Math::Vector cPos = m_object->GetPosition(0); @@ -509,7 +509,7 @@ void CAutoSafe::DownKeys(float progress) // Delete all the keys. -void CAutoSafe::DeleteKeys() +void CAutoVault::DeleteKeys() { Math::Vector cPos = m_object->GetPosition(0); @@ -541,7 +541,7 @@ void CAutoSafe::DeleteKeys() // Seeking a vehicle in the safe. -CObject* CAutoSafe::SearchVehicle() +CObject* CAutoVault::SearchVehicle() { Math::Vector cPos = m_object->GetPosition(0); diff --git a/src/object/auto/autosafe.h b/src/object/auto/autovault.h similarity index 92% rename from src/object/auto/autosafe.h rename to src/object/auto/autovault.h index fa8ed834..56683f31 100644 --- a/src/object/auto/autosafe.h +++ b/src/object/auto/autovault.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// autosafe.h +// autovault.h #pragma once @@ -26,7 +26,7 @@ -enum AutoSafePhase +enum AutoVaultPhase { ASAP_WAIT = 1, ASAP_OPEN = 2, @@ -35,11 +35,11 @@ enum AutoSafePhase -class CAutoSafe : public CAuto +class CAutoVault : public CAuto { public: - CAutoSafe(CObject* object); - ~CAutoSafe(); + CAutoVault(CObject* object); + ~CAutoVault(); void DeleteObject(bool bAll=false); @@ -60,7 +60,7 @@ protected: CObject* SearchVehicle(); protected: - AutoSafePhase m_phase; + AutoVaultPhase m_phase; float m_progress; float m_speed; float m_timeVirus; diff --git a/src/object/motion/motiondummy.cpp b/src/object/motion/motionlevelcontroller.cpp similarity index 87% rename from src/object/motion/motiondummy.cpp rename to src/object/motion/motionlevelcontroller.cpp index 9f2747ce..b3bbe7c3 100644 --- a/src/object/motion/motiondummy.cpp +++ b/src/object/motion/motionlevelcontroller.cpp @@ -18,7 +18,7 @@ */ -#include "object/motion/motiondummy.h" +#include "object/motion/motionlevelcontroller.h" #include "physics/physics.h" #include "graphics/engine/oldmodelmanager.h" @@ -27,27 +27,27 @@ // Object's constructor. -CMotionDummy::CMotionDummy(CObject* object) : CMotion(object) +CMotionLevelController::CMotionLevelController(CObject* object) : CMotion(object) { } // Object's destructor. -CMotionDummy::~CMotionDummy() +CMotionLevelController::~CMotionLevelController() { } // Removes an object. -void CMotionDummy::DeleteObject(bool bAll) +void CMotionLevelController::DeleteObject(bool bAll) { } -// Creates a Dummy traveling any lands on the ground. +// Creates a LevelController motion -void CMotionDummy::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionLevelController::Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager*) { m_object->SetType(type); diff --git a/src/object/motion/motiondummy.h b/src/object/motion/motionlevelcontroller.h similarity index 87% rename from src/object/motion/motiondummy.h rename to src/object/motion/motionlevelcontroller.h index 7c449d27..6efc031b 100644 --- a/src/object/motion/motiondummy.h +++ b/src/object/motion/motionlevelcontroller.h @@ -17,18 +17,18 @@ * along with this program. If not, see http://gnu.org/licenses */ -// motiondummy.h +// motionlevelcontroller.h #pragma once #include "object/motion/motion.h" -class CMotionDummy : public CMotion +class CMotionLevelController : public CMotion { public: - CMotionDummy(CObject* object); - ~CMotionDummy(); + CMotionLevelController(CObject* object); + ~CMotionLevelController(); void DeleteObject(bool bAll=false); void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager); diff --git a/src/object/motion/motionmother.cpp b/src/object/motion/motionqueen.cpp similarity index 97% rename from src/object/motion/motionmother.cpp rename to src/object/motion/motionqueen.cpp index f96eacd6..1aa90832 100644 --- a/src/object/motion/motionmother.cpp +++ b/src/object/motion/motionqueen.cpp @@ -18,7 +18,7 @@ */ -#include "object/motion/motionmother.h" +#include "object/motion/motionqueen.h" #include "app/app.h" @@ -37,7 +37,7 @@ const float START_TIME = 1000.0f; // beginning of the relative time // Object's constructor. -CMotionMother::CMotionMother(CObject* object) : CMotion(object) +CMotionQueen::CMotionQueen(CObject* object) : CMotion(object) { m_armMember = START_TIME; m_armTimeAbs = START_TIME; @@ -53,21 +53,21 @@ CMotionMother::CMotionMother(CObject* object) : CMotion(object) // Object's destructor. -CMotionMother::~CMotionMother() +CMotionQueen::~CMotionQueen() { } // Removes an object. -void CMotionMother::DeleteObject(bool bAll) +void CMotionQueen::DeleteObject(bool bAll) { } // Creates a vehicle traveling any lands on the ground. -void CMotionMother::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank; @@ -255,7 +255,7 @@ void CMotionMother::Create(Math::Vector pos, float angle, ObjectType type, // Creates the physics of the object. -void CMotionMother::CreatePhysics() +void CMotionQueen::CreatePhysics() { Character* character; int i; @@ -311,7 +311,7 @@ void CMotionMother::CreatePhysics() // Management of an event. -bool CMotionMother::EventProcess(const Event &event) +bool CMotionQueen::EventProcess(const Event &event) { CMotion::EventProcess(event); @@ -355,7 +355,7 @@ bool CMotionMother::EventProcess(const Event &event) // Management of an event. -bool CMotionMother::EventFrame(const Event &event) +bool CMotionQueen::EventFrame(const Event &event) { Math::Vector dir; float s, a, prog; diff --git a/src/object/motion/motionmother.h b/src/object/motion/motionqueen.h similarity index 93% rename from src/object/motion/motionmother.h rename to src/object/motion/motionqueen.h index 90684339..75302a67 100644 --- a/src/object/motion/motionmother.h +++ b/src/object/motion/motionqueen.h @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -// motionmother.h +// motionqueen.h #pragma once @@ -26,11 +26,11 @@ -class CMotionMother : public CMotion +class CMotionQueen : public CMotion { public: - CMotionMother(CObject* object); - ~CMotionMother(); + CMotionQueen(CObject* object); + ~CMotionQueen(); void DeleteObject(bool bAll=false); void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager); diff --git a/src/object/object_factory.cpp b/src/object/object_factory.cpp index 7a2f3f8a..734ab155 100644 --- a/src/object/object_factory.cpp +++ b/src/object/object_factory.cpp @@ -33,29 +33,29 @@ #include "object/auto/autoderrick.h" #include "object/auto/autodestroyer.h" #include "object/auto/autoegg.h" -#include "object/auto/autoenergy.h" +#include "object/auto/autopowerplant.h" #include "object/auto/autofactory.h" #include "object/auto/autoflag.h" -#include "object/auto/autohuston.h" +#include "object/auto/autohouston.h" #include "object/auto/autojostle.h" #include "object/auto/autolabo.h" #include "object/auto/automush.h" #include "object/auto/autonest.h" -#include "object/auto/autonuclear.h" -#include "object/auto/autopara.h" +#include "object/auto/autonuclearplant.h" +#include "object/auto/autopowercaptor.h" #include "object/auto/autoportico.h" #include "object/auto/autoradar.h" #include "object/auto/autorepair.h" #include "object/auto/autoresearch.h" #include "object/auto/autoroot.h" -#include "object/auto/autosafe.h" -#include "object/auto/autostation.h" +#include "object/auto/autovault.h" +#include "object/auto/autopowerstation.h" #include "object/auto/autotower.h" #include "object/motion/motionant.h" #include "object/motion/motionbee.h" -#include "object/motion/motiondummy.h" +#include "object/motion/motionlevelcontroller.h" #include "object/motion/motionhuman.h" -#include "object/motion/motionmother.h" +#include "object/motion/motionqueen.h" #include "object/motion/motionspider.h" #include "object/motion/motiontoto.h" #include "object/motion/motionvehicle.h" @@ -2627,7 +2627,7 @@ CObjectUPtr CObjectFactory::CreateVehicle(const ObjectCreateParams& params) } else if ( type == OBJECT_CONTROLLER ) { - motion.reset(new CMotionDummy(obj.get())); //dummy object + motion.reset(new CMotionLevelController(obj.get())); //dummy object } else { @@ -2668,7 +2668,7 @@ CObjectUPtr CObjectFactory::CreateInsect(const ObjectCreateParams& params) std::unique_ptr motion; if ( type == OBJECT_MOTHER ) { - motion.reset(new CMotionMother(obj.get())); + motion.reset(new CMotionQueen(obj.get())); } if ( type == OBJECT_ANT ) { @@ -2738,7 +2738,7 @@ void CObjectFactory::AddObjectAuto(COldObject* obj) } if ( type == OBJECT_STATION ) { - objAuto.reset(new CAutoStation(obj)); + objAuto.reset(new CAutoPowerStation(obj)); } if ( type == OBJECT_CONVERT ) { @@ -2758,7 +2758,7 @@ void CObjectFactory::AddObjectAuto(COldObject* obj) } if ( type == OBJECT_ENERGY ) { - objAuto.reset(new CAutoEnergy(obj)); + objAuto.reset(new CAutoPowerPlant(obj)); } if ( type == OBJECT_LABO ) { @@ -2766,19 +2766,19 @@ void CObjectFactory::AddObjectAuto(COldObject* obj) } if ( type == OBJECT_NUCLEAR ) { - objAuto.reset(new CAutoNuclear(obj)); + objAuto.reset(new CAutoNuclearPlant(obj)); } if ( type == OBJECT_PARA ) { - objAuto.reset(new CAutoPara(obj)); + objAuto.reset(new CAutoPowerCaptor(obj)); } if ( type == OBJECT_SAFE ) { - objAuto.reset(new CAutoSafe(obj)); + objAuto.reset(new CAutoVault(obj)); } if ( type == OBJECT_HUSTON ) { - objAuto.reset(new CAutoHuston(obj)); + objAuto.reset(new CAutoHouston(obj)); } if ( type == OBJECT_EGG ) {