widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #02528
[Merge] lp:~widelands-dev/widelands/bug-1343297 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1343297 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1343297 in widelands: "Rename Oddly_Separated_Classes to OddlySeparatedClasses"
https://bugs.launchpad.net/widelands/+bug/1343297
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1343297/+merge/228552
Part 1 - MapObject and Descr classes
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1343297/+merge/228552
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1343297 into lp:widelands.
=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h 2014-07-14 10:45:44 +0000
+++ src/ai/ai_help_structs.h 2014-07-28 18:15:26 +0000
@@ -284,7 +284,7 @@
struct BuildingObserver {
char const* name;
Widelands::Building_Index id;
- Widelands::Building_Descr const* desc;
+ Widelands::BuildingDescr const* desc;
enum {
BORING,
=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc 2014-07-26 10:15:48 +0000
+++ src/ai/defaultai.cc 2014-07-28 18:15:26 +0000
@@ -246,7 +246,7 @@
const World& world = game().world();
for (Building_Index i = 0; i < nr_buildings; ++i) {
- const Building_Descr& bld = *tribe_->get_building_descr(i);
+ const BuildingDescr& bld = *tribe_->get_building_descr(i);
const std::string& building_name = bld.name();
const BuildingHints& bh = bld.hints();
buildings_.resize(buildings_.size() + 1);
@@ -292,9 +292,9 @@
bo.plants_trees_ = false;
// Read all interesting data from ware producing buildings
- if (typeid(bld) == typeid(ProductionSite_Descr)) {
- const ProductionSite_Descr& prod =
- ref_cast<ProductionSite_Descr const, Building_Descr const>(bld);
+ if (typeid(bld) == typeid(ProductionSiteDescr)) {
+ const ProductionSiteDescr& prod =
+ ref_cast<ProductionSiteDescr const, BuildingDescr const>(bld);
bo.type = bld.get_ismine() ? BuildingObserver::MINE : BuildingObserver::PRODUCTIONSITE;
for (const WareAmount& temp_input : prod.inputs()) {
bo.inputs_.push_back(temp_input.first);
@@ -324,22 +324,22 @@
continue;
}
- if (typeid(bld) == typeid(MilitarySite_Descr)) {
+ if (typeid(bld) == typeid(MilitarySiteDescr)) {
bo.type = BuildingObserver::MILITARYSITE;
continue;
}
- if (typeid(bld) == typeid(Warehouse_Descr)) {
+ if (typeid(bld) == typeid(WarehouseDescr)) {
bo.type = BuildingObserver::WAREHOUSE;
continue;
}
- if (typeid(bld) == typeid(TrainingSite_Descr)) {
+ if (typeid(bld) == typeid(TrainingSiteDescr)) {
bo.type = BuildingObserver::TRAININGSITE;
continue;
}
- if (typeid(bld) == typeid(ConstructionSite_Descr)) {
+ if (typeid(bld) == typeid(ConstructionSiteDescr)) {
bo.type = BuildingObserver::CONSTRUCTIONSITE;
continue;
}
@@ -511,7 +511,7 @@
// Is this a general update or just for military consideration
// (second is used in check_militarysites)
if (!military) {
- int32_t const tree_attr = Map_Object_Descr::get_attribute_id("tree");
+ int32_t const tree_attr = MapObjectDescr::get_attribute_id("tree");
field.reachable = false;
field.preferred_ = false;
field.enemy_nearby_ = false;
@@ -577,9 +577,9 @@
if (upcast(Building const, building, &base_immovable)) {
if (upcast(ConstructionSite const, constructionsite, building)) {
- const Building_Descr& target_descr = constructionsite->building();
+ const BuildingDescr& target_descr = constructionsite->building();
- if (dynamic_cast<ProductionSite_Descr const*>(&target_descr))
+ if (dynamic_cast<ProductionSiteDescr const*>(&target_descr))
consider_productionsite_influence(
field,
immovables.at(i).coords,
@@ -598,7 +598,7 @@
// stones are not renewable, we will count them only if previous state si nonzero
if (field.stones_nearby_ > 0) {
- int32_t const stone_attr = Map_Object_Descr::get_attribute_id("granite");
+ int32_t const stone_attr = MapObjectDescr::get_attribute_id("granite");
field.stones_nearby_ = 0;
for (uint32_t j = 0; j < immovables.size(); ++j) {
@@ -636,9 +636,9 @@
if (upcast(Building const, building, &base_immovable)) {
if (upcast(ConstructionSite const, constructionsite, building)) {
- const Building_Descr& target_descr = constructionsite->building();
+ const BuildingDescr& target_descr = constructionsite->building();
- if (upcast(MilitarySite_Descr const, target_ms_d, &target_descr)) {
+ if (upcast(MilitarySiteDescr const, target_ms_d, &target_descr)) {
const int32_t dist = map.calc_distance(field.coords, immovables.at(i).coords);
const int32_t radius = target_ms_d->get_conquers() + 4;
const int32_t v = radius - dist;
@@ -1835,7 +1835,7 @@
if (site.bo->need_trees_) {
if (map.find_immovables(Area<FCoords>(map.get_fcoords(site.site->get_position()), radius),
nullptr,
- FindImmovableAttribute(Map_Object_Descr::get_attribute_id("tree"))) <
+ FindImmovableAttribute(MapObjectDescr::get_attribute_id("tree"))) <
6) {
// Do not destruct the last lumberjack - perhaps some small trees are
// near, a forester will plant some trees or some new trees will seed
@@ -1883,7 +1883,7 @@
if (map.find_immovables(
Area<FCoords>(map.get_fcoords(site.site->get_position()), radius),
nullptr,
- FindImmovableAttribute(Map_Object_Descr::get_attribute_id("granite"))) == 0) {
+ FindImmovableAttribute(MapObjectDescr::get_attribute_id("granite"))) == 0) {
// destruct the building and it's flag (via flag destruction)
// the destruction of the flag avoids that defaultAI will have too many
// unused roads - if needed the road will be rebuild directly.
@@ -2021,7 +2021,7 @@
// Only enhance buildings that are allowed (scenario mode)
if (player_->is_building_type_allowed(enhancement)) {
- const Building_Descr& bld = *tribe_->get_building_descr(enhancement);
+ const BuildingDescr& bld = *tribe_->get_building_descr(enhancement);
BuildingObserver& en_bo = get_building_observer(bld.name().c_str());
// do not build the same building so soon (kind of duplicity check)
@@ -2128,7 +2128,7 @@
// Only enhance buildings that are allowed (scenario mode)
if (player_->is_building_type_allowed(enhancement)) {
// first exclude possibility there are enhancements in construction or unoccupied_
- const Building_Descr& bld = *tribe_->get_building_descr(enhancement);
+ const BuildingDescr& bld = *tribe_->get_building_descr(enhancement);
BuildingObserver& en_bo = get_building_observer(bld.name().c_str());
if (en_bo.unoccupied_ + en_bo.cnt_under_construction_ <= 0)
=== modified file 'src/economy/cmd_call_economy_balance.cc'
--- src/economy/cmd_call_economy_balance.cc 2014-07-20 07:42:37 +0000
+++ src/economy/cmd_call_economy_balance.cc 2014-07-28 18:15:26 +0000
@@ -54,7 +54,7 @@
* Read and write
*/
void Cmd_Call_Economy_Balance::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -91,7 +91,7 @@
}
}
void Cmd_Call_Economy_Balance::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_CMD_CALL_ECONOMY_VERSION);
=== modified file 'src/economy/cmd_call_economy_balance.h'
--- src/economy/cmd_call_economy_balance.h 2014-07-26 10:43:23 +0000
+++ src/economy/cmd_call_economy_balance.h 2014-07-28 18:15:26 +0000
@@ -27,7 +27,7 @@
namespace Widelands {
class Economy;
class Game;
-class Map_Map_Object_Loader;
+class MapMapObjectLoader;
struct Cmd_Call_Economy_Balance : public GameLogicCommand {
@@ -39,8 +39,8 @@
uint8_t id() const override {return QUEUE_CMD_CALL_ECONOMY_BALANCE;}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
private:
OPtr<Flag> m_flag;
=== modified file 'src/economy/economy.cc'
--- src/economy/economy.cc 2014-07-25 20:40:51 +0000
+++ src/economy/economy.cc 2014-07-28 18:15:26 +0000
@@ -813,12 +813,12 @@
bool soldier_level_check;
const Tribe_Descr & tribe = owner().tribe();
- const Worker_Descr & w_desc = *tribe.get_worker_descr(index);
+ const WorkerDescr & w_desc = *tribe.get_worker_descr(index);
// Make a dummy soldier, which should never be assigned to any economy
// Minimal invasive fix of bug 1236538: never create a rookie for a request
// that required a hero.
- if (upcast(const Soldier_Descr, s_desc, &w_desc)) {
+ if (upcast(const SoldierDescr, s_desc, &w_desc)) {
if (!m_soldier_prototype) {
Soldier* test_rookie = static_cast<Soldier*> (&(s_desc->create_object()));
m_soldier_prototype.reset(test_rookie);
@@ -856,7 +856,7 @@
// We have worker demand that is not fulfilled by supplies
// Find warehouses where we can create the required workers,
// and collect stats about existing build prerequisites
- const Worker_Descr::Buildcost & cost = w_desc.buildcost();
+ const WorkerDescr::Buildcost & cost = w_desc.buildcost();
std::vector<uint32_t> total_available;
uint32_t total_planned = 0;
=== modified file 'src/economy/economy_data_packet.h'
--- src/economy/economy_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/economy/economy_data_packet.h 2014-07-28 18:15:26 +0000
@@ -26,8 +26,8 @@
namespace Widelands {
class Economy;
class Game;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
class EconomyDataPacket {
public:
=== modified file 'src/economy/flag.cc'
--- src/economy/flag.cc 2014-07-25 22:38:39 +0000
+++ src/economy/flag.cc 2014-07-28 18:15:26 +0000
@@ -38,9 +38,9 @@
namespace Widelands {
-Flag_Descr g_flag_descr("flag", "Flag");
+FlagDescr g_flag_descr("flag", "Flag");
-const Flag_Descr& Flag::descr() const {
+const FlagDescr& Flag::descr() const {
return g_flag_descr;
}
=== modified file 'src/economy/flag.h'
--- src/economy/flag.h 2014-07-26 10:43:23 +0000
+++ src/economy/flag.h 2014-07-28 18:15:26 +0000
@@ -33,16 +33,16 @@
struct Road;
class WareInstance;
-class Flag_Descr : public Map_Object_Descr {
+class FlagDescr : public MapObjectDescr {
public:
- Flag_Descr(char const* const _name, char const* const _descname)
- : Map_Object_Descr(Map_Object_Type::FLAG, _name, _descname) {
+ FlagDescr(char const* const _name, char const* const _descname)
+ : MapObjectDescr(MapObjectType::FLAG, _name, _descname) {
}
- ~Flag_Descr() override {
+ ~FlagDescr() override {
}
private:
- DISALLOW_COPY_AND_ASSIGN(Flag_Descr);
+ DISALLOW_COPY_AND_ASSIGN(FlagDescr);
};
/**
@@ -70,7 +70,7 @@
friend struct Map_Waredata_Data_Packet; // has to look at pending wares
friend struct Router;
- const Flag_Descr& descr() const;
+ const FlagDescr& descr() const;
Flag(); /// empty flag for savegame loading
Flag(Editor_Game_Base &, Player & owner, Coords); /// create a new flag
@@ -176,7 +176,7 @@
FlagJobs m_flag_jobs;
};
-extern Flag_Descr g_flag_descr;
+extern FlagDescr g_flag_descr;
}
#endif // end of include guard: WL_ECONOMY_FLAG_H
=== modified file 'src/economy/fleet.cc'
--- src/economy/fleet.cc 2014-07-25 22:38:39 +0000
+++ src/economy/fleet.cc 2014-07-28 18:15:26 +0000
@@ -41,12 +41,12 @@
namespace Widelands {
namespace {
-// Every Map_Object() needs to have a description. So we make a dummy one for
+// Every MapObject() needs to have a description. So we make a dummy one for
// Fleet.
-Fleet_Descr g_fleet_descr("fleet", "Fleet");
+FleetDescr g_fleet_descr("fleet", "Fleet");
} // namespace
-const Fleet_Descr& Fleet::descr() const {
+const FleetDescr& Fleet::descr() const {
return g_fleet_descr;
}
@@ -58,7 +58,7 @@
* The Fleet takes care of merging with existing fleets, if any.
*/
Fleet::Fleet(Player & player) :
- Map_Object(&g_fleet_descr),
+ MapObject(&g_fleet_descr),
m_owner(player),
m_act_pending(false)
{
@@ -103,7 +103,7 @@
*/
void Fleet::init(Editor_Game_Base & egbase)
{
- Map_Object::init(egbase);
+ MapObject::init(egbase);
if (m_ships.empty() && m_ports.empty()) {
molog("Empty fleet initialized; disband immediately\n");
@@ -161,7 +161,7 @@
FCoords cur;
while (astar.step(cur, cost)) {
if (BaseImmovable * imm = cur.field->get_immovable()) {
- if (imm->descr().type() == Map_Object_Type::PORTDOCK) {
+ if (imm->descr().type() == MapObjectType::PORTDOCK) {
if (upcast(PortDock, dock, imm)) {
if (dock->get_fleet() != this && dock->get_owner() == get_owner()) {
dock->get_fleet()->merge(egbase, this);
@@ -172,7 +172,7 @@
}
for (Bob * bob = cur.field->get_first_bob(); bob != nullptr; bob = bob->get_next_bob()) {
- if (bob->descr().type() != Map_Object_Type::SHIP)
+ if (bob->descr().type() != MapObjectType::SHIP)
continue;
if (upcast(Ship, ship, bob)) {
@@ -265,7 +265,7 @@
m_ships.pop_back();
}
- Map_Object::cleanup(egbase);
+ MapObject::cleanup(egbase);
}
Fleet::PortPath & Fleet::portpath(uint32_t i, uint32_t j)
@@ -465,7 +465,7 @@
FCoords cur;
while (!se.targets.empty() && astar.step(cur, cost)) {
BaseImmovable * imm = cur.field->get_immovable();
- if (!imm || imm->descr().type() != Map_Object_Type::PORTDOCK)
+ if (!imm || imm->descr().type() != MapObjectType::PORTDOCK)
continue;
if (upcast(PortDock, pd, imm)) {
@@ -674,7 +674,7 @@
void Fleet::log_general_info(const Editor_Game_Base & egbase)
{
- Map_Object::log_general_info(egbase);
+ MapObject::log_general_info(egbase);
molog
("%" PRIuS " ships and %" PRIuS " ports\n", m_ships.size(), m_ports.size());
@@ -688,7 +688,7 @@
void Fleet::Loader::load(FileRead & fr, uint8_t version)
{
- Map_Object::Loader::load(fr);
+ MapObject::Loader::load(fr);
Fleet & fleet = get<Fleet>();
@@ -713,7 +713,7 @@
void Fleet::Loader::load_pointers()
{
- Map_Object::Loader::load_pointers();
+ MapObject::Loader::load_pointers();
Fleet & fleet = get<Fleet>();
@@ -737,7 +737,7 @@
void Fleet::Loader::load_finish()
{
- Map_Object::Loader::load_finish();
+ MapObject::Loader::load_finish();
Fleet & fleet = get<Fleet>();
@@ -749,8 +749,8 @@
}
}
-Map_Object::Loader * Fleet::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * Fleet::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
std::unique_ptr<Loader> loader(new Loader);
@@ -779,14 +779,14 @@
return loader.release();
}
-void Fleet::save(Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+void Fleet::save(Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Fleet);
+ fw.Unsigned8(HeaderFleet);
fw.Unsigned8(FLEET_SAVEGAME_VERSION);
fw.Unsigned8(m_owner.player_number());
- Map_Object::save(egbase, mos, fw);
+ MapObject::save(egbase, mos, fw);
fw.Unsigned32(m_ships.size());
for (const Ship * temp_ship : m_ships) {
=== modified file 'src/economy/fleet.h'
--- src/economy/fleet.h 2014-07-26 10:43:23 +0000
+++ src/economy/fleet.h 2014-07-28 18:15:26 +0000
@@ -33,16 +33,16 @@
struct RoutingNodeNeighbour;
struct Ship;
-class Fleet_Descr : public Map_Object_Descr {
+class FleetDescr : public MapObjectDescr {
public:
- Fleet_Descr(char const* const _name, char const* const _descname)
- : Map_Object_Descr(Map_Object_Type::FLEET, _name, _descname) {
+ FleetDescr(char const* const _name, char const* const _descname)
+ : MapObjectDescr(MapObjectType::FLEET, _name, _descname) {
}
- ~Fleet_Descr() override {
+ ~FleetDescr() override {
}
private:
- DISALLOW_COPY_AND_ASSIGN(Fleet_Descr);
+ DISALLOW_COPY_AND_ASSIGN(FleetDescr);
};
/**
@@ -63,7 +63,7 @@
* again in reaction to changes in the map. However, this may not work
* properly at the moment.
*/
-struct Fleet : Map_Object {
+struct Fleet : MapObject {
struct PortPath {
int32_t cost;
boost::shared_ptr<Path> path;
@@ -71,7 +71,7 @@
PortPath() : cost(-1) {}
};
- const Fleet_Descr& descr() const;
+ const FleetDescr& descr() const;
Fleet(Player & player);
@@ -128,7 +128,7 @@
// saving and loading
protected:
- struct Loader : Map_Object::Loader {
+ struct Loader : MapObject::Loader {
Loader();
void load(FileRead &, uint8_t version);
@@ -142,10 +142,10 @@
public:
bool has_new_save_support() override {return true;}
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &);
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &);
};
} // namespace Widelands
=== modified file 'src/economy/portdock.cc'
--- src/economy/portdock.cc 2014-07-26 09:48:21 +0000
+++ src/economy/portdock.cc 2014-07-28 18:15:26 +0000
@@ -40,16 +40,16 @@
namespace Widelands {
-PortDock_Descr g_portdock_descr("portdock", "Port Dock");
+PortdockDescr g_portdock_descr("portdock", "Port Dock");
-const PortDock_Descr& PortDock::descr() const {
+const PortdockDescr& PortDock::descr() const {
return g_portdock_descr;
}
-PortDock_Descr::PortDock_Descr(char const* const _name, char const* const _descname)
+PortdockDescr::PortdockDescr(char const* const _name, char const* const _descname)
:
- Map_Object_Descr(Map_Object_Type::PORTDOCK, _name, _descname)
+ MapObjectDescr(MapObjectType::PORTDOCK, _name, _descname)
{
}
@@ -537,8 +537,8 @@
pd.init_fleet(egbase());
}
-Map_Object::Loader * PortDock::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * PortDock::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
std::unique_ptr<Loader> loader(new Loader);
@@ -558,9 +558,9 @@
return loader.release();
}
-void PortDock::save(Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+void PortDock::save(Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_PortDock);
+ fw.Unsigned8(HeaderPortDock);
fw.Unsigned8(PORTDOCK_SAVEGAME_VERSION);
PlayerImmovable::save(egbase, mos, fw);
=== modified file 'src/economy/portdock.h'
--- src/economy/portdock.h 2014-07-26 10:43:23 +0000
+++ src/economy/portdock.h 2014-07-28 18:15:26 +0000
@@ -35,14 +35,14 @@
class Warehouse;
class ExpeditionBootstrap;
-class PortDock_Descr : public Map_Object_Descr {
+class PortdockDescr : public MapObjectDescr {
public:
- PortDock_Descr(char const* const _name, char const* const _descname);
- ~PortDock_Descr() override {
+ PortdockDescr(char const* const _name, char const* const _descname);
+ ~PortdockDescr() override {
}
private:
- DISALLOW_COPY_AND_ASSIGN(PortDock_Descr);
+ DISALLOW_COPY_AND_ASSIGN(PortdockDescr);
};
/**
@@ -74,7 +74,7 @@
class PortDock : public PlayerImmovable {
public:
- const PortDock_Descr& descr() const;
+ const PortdockDescr& descr() const;
PortDock(Warehouse* warehouse);
~PortDock() override;
@@ -162,13 +162,13 @@
public:
bool has_new_save_support() override {return true;}
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &);
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &);
};
-extern PortDock_Descr g_portdock_descr;
+extern PortdockDescr g_portdock_descr;
} // namespace Widelands
=== modified file 'src/economy/request.cc'
--- src/economy/request.cc 2014-07-20 07:42:37 +0000
+++ src/economy/request.cc 2014-07-28 18:15:26 +0000
@@ -106,7 +106,7 @@
* them through the data in the file
*/
void Request::Read
- (FileRead & fr, Game & game, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Game & game, MapMapObjectLoader & mol)
{
try {
uint16_t const version = fr.Unsigned16();
@@ -137,7 +137,7 @@
uint16_t const nr_transfers = fr.Unsigned16();
for (uint16_t i = 0; i < nr_transfers; ++i)
try {
- Map_Object* obj = &mol.get<Map_Object>(fr.Unsigned32());
+ MapObject* obj = &mol.get<MapObject>(fr.Unsigned32());
Transfer* transfer;
if (upcast(Worker, worker, obj)) {
@@ -178,7 +178,7 @@
* Write this request to a file
*/
void Request::Write
- (FileWrite & fw, Game & game, Map_Map_Object_Saver & mos) const
+ (FileWrite & fw, Game & game, MapMapObjectSaver & mos) const
{
fw.Unsigned16(REQUEST_VERSION);
=== modified file 'src/economy/request.h'
--- src/economy/request.h 2014-07-05 16:41:51 +0000
+++ src/economy/request.h 2014-07-28 18:15:26 +0000
@@ -34,8 +34,8 @@
class Editor_Game_Base;
struct Flag;
class Game;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
struct PlayerImmovable;
class RequestList;
struct Requirements;
@@ -93,8 +93,8 @@
void start_transfer(Game &, Supply &);
- void Read (FileRead &, Game &, Map_Map_Object_Loader &);
- void Write(FileWrite &, Game &, Map_Map_Object_Saver &) const;
+ void Read (FileRead &, Game &, MapMapObjectLoader &);
+ void Write(FileWrite &, Game &, MapMapObjectSaver &) const;
Worker * get_transfer_worker();
// callbacks for WareInstance/Worker code
=== modified file 'src/economy/road.cc'
--- src/economy/road.cc 2014-07-25 22:38:39 +0000
+++ src/economy/road.cc 2014-07-28 18:15:26 +0000
@@ -32,16 +32,16 @@
namespace Widelands {
-// dummy instance because Map_Object needs a description
+// dummy instance because MapObject needs a description
namespace {
-const Road_Descr g_road_descr("road", "Road");
+const RoadDescr g_road_descr("road", "Road");
}
-const Road_Descr& Road::descr() const {
+const RoadDescr& Road::descr() const {
return g_road_descr;
}
-bool Road::IsRoadDescr(Map_Object_Descr const * const descr)
+bool Road::IsRoadDescr(MapObjectDescr const * const descr)
{
return descr == &g_road_descr;
}
=== modified file 'src/economy/road.h'
--- src/economy/road.h 2014-07-26 10:43:23 +0000
+++ src/economy/road.h 2014-07-28 18:15:26 +0000
@@ -31,15 +31,15 @@
struct Carrier;
class Request;
-class Road_Descr : public Map_Object_Descr {
+class RoadDescr : public MapObjectDescr {
public:
- Road_Descr(char const* const _name, char const* const _descname)
- : Map_Object_Descr(Map_Object_Type::ROAD, _name, _descname) {
+ RoadDescr(char const* const _name, char const* const _descname)
+ : MapObjectDescr(MapObjectType::ROAD, _name, _descname) {
}
- ~Road_Descr() override {}
+ ~RoadDescr() override {}
private:
- DISALLOW_COPY_AND_ASSIGN(Road_Descr);
+ DISALLOW_COPY_AND_ASSIGN(RoadDescr);
};
/**
@@ -61,9 +61,9 @@
friend class Map_Roaddata_Data_Packet; // For saving
friend class Map_Road_Data_Packet; // For init()
- const Road_Descr& descr() const;
+ const RoadDescr& descr() const;
- static bool IsRoadDescr(Map_Object_Descr const *);
+ static bool IsRoadDescr(MapObjectDescr const *);
enum FlagId {
FlagStart = 0,
=== modified file 'src/economy/route.cc'
--- src/economy/route.cc 2014-05-11 07:38:01 +0000
+++ src/economy/route.cc 2014-07-28 18:15:26 +0000
@@ -102,7 +102,7 @@
* load_pointers phase of loading: This is responsible for filling
* in the \ref Flag pointers. Must be called after \ref load.
*/
-void Route::load_pointers(const LoadData & data, Map_Map_Object_Loader & mol) {
+void Route::load_pointers(const LoadData & data, MapMapObjectLoader & mol) {
for (uint32_t i = 0; i < data.flags.size(); ++i) {
uint32_t const flag_serial = data.flags.size();
try {
@@ -118,7 +118,7 @@
* Save the route to the given file.
*/
void Route::save
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Signed32(get_totalcost());
fw.Unsigned16(m_route.size());
=== modified file 'src/economy/route.h'
--- src/economy/route.h 2014-07-05 16:41:51 +0000
+++ src/economy/route.h 2014-07-28 18:15:26 +0000
@@ -30,8 +30,8 @@
struct Flag;
class Editor_Game_Base;
-struct Map_Map_Object_Saver;
-class Map_Map_Object_Loader;
+struct MapMapObjectSaver;
+class MapMapObjectLoader;
struct RoutingNode;
/**
@@ -58,8 +58,8 @@
};
void load(LoadData &, FileRead &);
- void load_pointers(const LoadData &, Map_Map_Object_Loader &);
- void save(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &);
+ void load_pointers(const LoadData &, MapMapObjectLoader &);
+ void save(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &);
void insert_as_first(RoutingNode * node) override;
=== modified file 'src/economy/shippingitem.cc'
--- src/economy/shippingitem.cc 2014-07-26 09:48:21 +0000
+++ src/economy/shippingitem.cc 2014-07-28 18:15:26 +0000
@@ -48,12 +48,12 @@
*worker = nullptr;
}
- Map_Object* obj = m_object.get(game);
+ MapObject* obj = m_object.get(game);
if (!obj) {
return;
}
- if (obj->descr().type() == Map_Object_Type::WARE) {
+ if (obj->descr().type() == MapObjectType::WARE) {
if (ware) {
*ware = dynamic_cast<WareInstance*>(obj);
}
@@ -77,7 +77,7 @@
worker->set_economy(e);
}
-void ShippingItem::set_location(Game& game, Map_Object* obj) {
+void ShippingItem::set_location(Game& game, MapObject* obj) {
WareInstance * ware;
Worker * worker;
get(game, &ware, &worker);
@@ -156,7 +156,7 @@
*/
void ShippingItem::remove(Editor_Game_Base & egbase)
{
- if (Map_Object * obj = m_object.get(egbase)) {
+ if (MapObject * obj = m_object.get(egbase)) {
obj->remove(egbase);
m_object = nullptr;
}
@@ -174,15 +174,15 @@
throw game_data_error("unknown ShippingItem version %u", version);
}
-ShippingItem ShippingItem::Loader::get(Map_Map_Object_Loader & mol)
+ShippingItem ShippingItem::Loader::get(MapMapObjectLoader & mol)
{
ShippingItem it;
if (m_serial != 0)
- it.m_object = &mol.get<Map_Object>(m_serial);
+ it.m_object = &mol.get<MapObject>(m_serial);
return it;
}
-void ShippingItem::save(Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+void ShippingItem::save(Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
fw.Unsigned8(SHIPPINGITEM_SAVEGAME_VERSION);
fw.Unsigned32(mos.get_object_file_index_or_zero(m_object.get(egbase)));
=== modified file 'src/economy/shippingitem.h'
--- src/economy/shippingitem.h 2014-07-05 16:41:51 +0000
+++ src/economy/shippingitem.h 2014-07-28 18:15:26 +0000
@@ -30,9 +30,9 @@
class Economy;
class Game;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
-class Map_Object;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
+class MapObject;
class PortDock;
class WareInstance;
class Worker;
@@ -59,13 +59,13 @@
struct Loader {
void load(FileRead & fr);
- ShippingItem get(Map_Map_Object_Loader & mol);
+ ShippingItem get(MapMapObjectLoader & mol);
private:
uint32_t m_serial;
};
- void save(Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw);
+ void save(Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw);
private:
friend class PortDock;
@@ -75,7 +75,7 @@
void end_shipping(Game &);
// Sets the location of this shippingitem, this could be a ship, a portdock or a warehouse.
- void set_location(Game&, Map_Object* obj);
+ void set_location(Game&, MapObject* obj);
// Updates m_destination_dock.
void update_destination(Game &, PortDock &);
=== modified file 'src/economy/transfer.cc'
--- src/economy/transfer.cc 2014-07-20 07:42:37 +0000
+++ src/economy/transfer.cc 2014-07-28 18:15:26 +0000
@@ -324,13 +324,13 @@
}
void Transfer::read_pointers
- (Map_Map_Object_Loader & mol, const Widelands::Transfer::ReadData & rd)
+ (MapMapObjectLoader & mol, const Widelands::Transfer::ReadData & rd)
{
if (rd.destination)
m_destination = &mol.get<PlayerImmovable>(rd.destination);
}
-void Transfer::write(Map_Map_Object_Saver & mos, FileWrite & fw)
+void Transfer::write(MapMapObjectSaver & mos, FileWrite & fw)
{
fw.Unsigned8(TRANSFER_SAVEGAME_VERSION);
fw.Unsigned32(mos.get_object_file_index_or_zero(m_destination.get(m_game)));
=== modified file 'src/economy/transfer.h'
--- src/economy/transfer.h 2014-07-05 16:41:51 +0000
+++ src/economy/transfer.h 2014-07-28 18:15:26 +0000
@@ -27,8 +27,8 @@
struct PlayerImmovable;
class Request;
class WareInstance;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
class Worker;
/**
@@ -70,8 +70,8 @@
};
void read(FileRead & fr, ReadData & rd);
- void read_pointers(Map_Map_Object_Loader & mol, const ReadData & rd);
- void write(Map_Map_Object_Saver & mos, FileWrite & fw);
+ void read_pointers(MapMapObjectLoader & mol, const ReadData & rd);
+ void write(MapMapObjectSaver & mos, FileWrite & fw);
private:
void tlog(char const * fmt, ...) PRINTF_FORMAT(2, 3);
=== modified file 'src/economy/ware_instance.cc'
--- src/economy/ware_instance.cc 2014-07-26 10:43:23 +0000
+++ src/economy/ware_instance.cc 2014-07-28 18:15:26 +0000
@@ -103,7 +103,7 @@
*/
PlayerImmovable * IdleWareSupply::get_position(Game & game)
{
- Map_Object * const loc = m_ware.get_location(game);
+ MapObject * const loc = m_ware.get_location(game);
if (upcast(PlayerImmovable, playerimmovable, loc))
return playerimmovable;
@@ -185,7 +185,7 @@
WareInstance::WareInstance
(Ware_Index const i, const WareDescr * const ware_descr)
:
-Map_Object (ware_descr),
+MapObject (ware_descr),
m_economy (nullptr),
m_descr_index(i),
m_supply (nullptr),
@@ -202,7 +202,7 @@
void WareInstance::init(Editor_Game_Base & egbase)
{
- Map_Object::init(egbase);
+ MapObject::init(egbase);
}
void WareInstance::cleanup(Editor_Game_Base & egbase)
@@ -217,7 +217,7 @@
cancel_moving();
set_location(egbase, nullptr);
- Map_Object::cleanup(egbase);
+ MapObject::cleanup(egbase);
}
/**
@@ -244,9 +244,9 @@
* Once you've assigned a ware to its new location, you usually have to call
* \ref update() as well.
*/
-void WareInstance::set_location(Editor_Game_Base & egbase, Map_Object * const location)
+void WareInstance::set_location(Editor_Game_Base & egbase, MapObject * const location)
{
- Map_Object * const oldlocation = m_location.get(egbase);
+ MapObject * const oldlocation = m_location.get(egbase);
if (oldlocation == location)
return;
@@ -303,7 +303,7 @@
if (!m_descr) // Upsy, we're not even initialized. Happens on load
return;
- Map_Object * const loc = m_location.get(game);
+ MapObject * const loc = m_location.get(game);
// Reset our state if we're not on location or outside an economy
if (!get_economy()) {
@@ -529,7 +529,7 @@
void WareInstance::log_general_info(const Editor_Game_Base & egbase)
{
- Map_Object::log_general_info(egbase);
+ MapObject::log_general_info(egbase);
molog("Ware: %s\n", descr().name().c_str());
molog("Location: %u\n", m_location.serial());
@@ -554,7 +554,7 @@
void WareInstance::Loader::load(FileRead & fr)
{
- Map_Object::Loader::load(fr);
+ MapObject::Loader::load(fr);
WareInstance & ware = get<WareInstance>();
m_location = fr.Unsigned32();
@@ -568,7 +568,7 @@
void WareInstance::Loader::load_pointers()
{
- Map_Object::Loader::load_pointers();
+ MapObject::Loader::load_pointers();
WareInstance & ware = get<WareInstance>();
@@ -576,16 +576,16 @@
// for removal via the update callback, but the game is saved just before the
// removal. This is why we allow a null location on load.
if (m_location)
- ware.set_location(egbase(), &mol().get<Map_Object>(m_location));
+ ware.set_location(egbase(), &mol().get<MapObject>(m_location));
if (m_transfer_nextstep)
- ware.m_transfer_nextstep = &mol().get<Map_Object>(m_transfer_nextstep);
+ ware.m_transfer_nextstep = &mol().get<MapObject>(m_transfer_nextstep);
if (ware.m_transfer)
ware.m_transfer->read_pointers(mol(), m_transfer);
}
void WareInstance::Loader::load_finish()
{
- Map_Object::Loader::load_finish();
+ MapObject::Loader::load_finish();
WareInstance & ware = get<WareInstance>();
if (!ware.m_transfer || !ware.m_transfer->get_request()) {
@@ -596,14 +596,14 @@
void WareInstance::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_WareInstance);
+ fw.Unsigned8(HeaderWareInstance);
fw.Unsigned8(WAREINSTANCE_SAVEGAME_VERSION);
fw.CString(descr().tribe().name());
fw.CString(descr().name());
- Map_Object::save(egbase, mos, fw);
+ MapObject::save(egbase, mos, fw);
fw.Unsigned32(mos.get_object_file_index_or_zero(m_location.get(egbase)));
fw.Unsigned32
@@ -616,8 +616,8 @@
}
}
-Map_Object::Loader * WareInstance::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * WareInstance::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
try {
uint8_t version = fr.Unsigned8();
=== modified file 'src/economy/ware_instance.h'
--- src/economy/ware_instance.h 2014-07-26 10:43:23 +0000
+++ src/economy/ware_instance.h 2014-07-28 18:15:26 +0000
@@ -32,7 +32,7 @@
class Editor_Game_Base;
class Game;
struct IdleWareSupply;
-class Map_Object;
+class MapObject;
struct PlayerImmovable;
struct Transfer;
@@ -52,7 +52,7 @@
* \li a \ref PortDock or \ref Ship where the ware is encapsulated in a \ref ShippingItem
* for seafaring
*/
-class WareInstance : public Map_Object {
+class WareInstance : public MapObject {
friend struct Map_Waredata_Data_Packet;
MO_DESCR(WareDescr)
@@ -61,7 +61,7 @@
WareInstance(Ware_Index, const WareDescr* const);
~WareInstance();
- Map_Object* get_location(Editor_Game_Base& egbase) {
+ MapObject* get_location(Editor_Game_Base& egbase) {
return m_location.get(egbase);
}
Economy* get_economy() const {
@@ -76,7 +76,7 @@
void act(Game&, uint32_t data) override;
void update(Game&);
- void set_location(Editor_Game_Base&, Map_Object* loc);
+ void set_location(Editor_Game_Base&, MapObject* loc);
void set_economy(Economy*);
void enter_building(Game&, Building& building);
@@ -105,7 +105,7 @@
// loading and saving stuff
protected:
- struct Loader : Map_Object::Loader {
+ struct Loader : MapObject::Loader {
Loader();
void load(FileRead&);
@@ -123,8 +123,8 @@
return true;
}
- void save(Editor_Game_Base&, Map_Map_Object_Saver&, FileWrite&) override;
- static Map_Object::Loader* load(Editor_Game_Base&, Map_Map_Object_Loader&, FileRead&);
+ void save(Editor_Game_Base&, MapMapObjectSaver&, FileWrite&) override;
+ static MapObject::Loader* load(Editor_Game_Base&, MapMapObjectLoader&, FileRead&);
};
}
=== modified file 'src/economy/wares_queue.cc'
--- src/economy/wares_queue.cc 2014-07-25 22:17:48 +0000
+++ src/economy/wares_queue.cc 2014-07-28 18:15:26 +0000
@@ -235,7 +235,7 @@
* Read and write
*/
#define WARES_QUEUE_DATA_PACKET_VERSION 2
-void WaresQueue::Write(FileWrite & fw, Game & game, Map_Map_Object_Saver & mos)
+void WaresQueue::Write(FileWrite & fw, Game & game, MapMapObjectSaver & mos)
{
fw.Unsigned16(WARES_QUEUE_DATA_PACKET_VERSION);
@@ -254,7 +254,7 @@
}
-void WaresQueue::Read(FileRead & fr, Game & game, Map_Map_Object_Loader & mol)
+void WaresQueue::Read(FileRead & fr, Game & game, MapMapObjectLoader & mol)
{
uint16_t const packet_version = fr.Unsigned16();
try {
=== modified file 'src/economy/wares_queue.h'
--- src/economy/wares_queue.h 2014-07-05 16:41:51 +0000
+++ src/economy/wares_queue.h 2014-07-28 18:15:26 +0000
@@ -28,8 +28,8 @@
class Economy;
class Editor_Game_Base;
class Game;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
class Player;
class Request;
class Worker;
@@ -67,8 +67,8 @@
Player & owner() const {return m_owner.owner();}
- void Read (FileRead &, Game &, Map_Map_Object_Loader &);
- void Write(FileWrite &, Game &, Map_Map_Object_Saver &);
+ void Read (FileRead &, Game &, MapMapObjectLoader &);
+ void Write(FileWrite &, Game &, MapMapObjectSaver &);
private:
static void request_callback
=== modified file 'src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc'
--- src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc 2014-07-25 13:45:18 +0000
+++ src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc 2014-07-28 18:15:26 +0000
@@ -111,7 +111,7 @@
const Widelands::Tribe_Descr & tribe = player.tribe();
Building_Index const nr_buildings = tribe.get_nrbuildings();
for (Building_Index i = 0; i < nr_buildings; ++i) {
- const Widelands::Building_Descr & building =
+ const Widelands::BuildingDescr & building =
*tribe.get_building_descr(i);
if (!building.is_enhanced() && !building.is_buildable())
continue;
@@ -153,7 +153,7 @@
Building_Index const building_index = source.get_selected();
source.remove_selected();
- const Widelands::Building_Descr & building =
+ const Widelands::BuildingDescr & building =
*m_player.tribe().get_building_descr(building_index);
target.add
(building.descname().c_str(),
=== modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.cc'
--- src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2014-07-25 22:17:48 +0000
+++ src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2014-07-28 18:15:26 +0000
@@ -26,7 +26,7 @@
#include "editor/editorinteractive.h"
#include "editor/tools/editor_place_bob_tool.h"
#include "graphic/graphic.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/map.h"
#include "logic/world/world.h"
#include "ui_basic/box.h"
@@ -88,7 +88,7 @@
}
const Widelands::BobDescr & descr = *world.get_bob_descr(i);
- upcast(Widelands::Critter_Bob_Descr const, critter_descr, &descr);
+ upcast(Widelands::CritterDescr const, critter_descr, &descr);
UI::Checkbox & cb = *new UI::Checkbox
(box,
pos,
=== modified file 'src/editor/ui_menus/editor_tool_place_immovable_options_menu.cc'
--- src/editor/ui_menus/editor_tool_place_immovable_options_menu.cc 2014-06-21 10:24:12 +0000
+++ src/editor/ui_menus/editor_tool_place_immovable_options_menu.cc 2014-07-28 18:15:26 +0000
@@ -38,7 +38,7 @@
using namespace Widelands;
-UI::Checkbox* create_immovable_checkbox(UI::Panel* parent, const Immovable_Descr& immovable_descr) {
+UI::Checkbox* create_immovable_checkbox(UI::Panel* parent, const ImmovableDescr& immovable_descr) {
const Image& pic =
g_gr->animations().get_animation(immovable_descr.main_animation()).representative_image(
RGBColor(0, 0, 0));
@@ -58,11 +58,11 @@
: Editor_Tool_Options_Menu(parent, registry, 0, 0, _("Immovable Select")) {
const Widelands::World& world = parent.egbase().world();
multi_select_menu_.reset(
- new CategorizedItemSelectionMenu<Widelands::Immovable_Descr, Editor_Place_Immovable_Tool>(
+ new CategorizedItemSelectionMenu<Widelands::ImmovableDescr, Editor_Place_Immovable_Tool>(
this,
world.editor_immovable_categories(),
world.immovables(),
- [this](UI::Panel* cb_parent, const Immovable_Descr& immovable_descr) {
+ [this](UI::Panel* cb_parent, const ImmovableDescr& immovable_descr) {
return create_immovable_checkbox(cb_parent, immovable_descr);
},
[this] {select_correct_tool();},
=== modified file 'src/editor/ui_menus/editor_tool_place_immovable_options_menu.h'
--- src/editor/ui_menus/editor_tool_place_immovable_options_menu.h 2014-07-05 16:41:51 +0000
+++ src/editor/ui_menus/editor_tool_place_immovable_options_menu.h 2014-07-28 18:15:26 +0000
@@ -36,7 +36,7 @@
virtual ~Editor_Tool_Place_Immovable_Options_Menu();
private:
- std::unique_ptr<CategorizedItemSelectionMenu<Widelands::Immovable_Descr, Editor_Place_Immovable_Tool>>
+ std::unique_ptr<CategorizedItemSelectionMenu<Widelands::ImmovableDescr, Editor_Place_Immovable_Tool>>
multi_select_menu_;
};
=== modified file 'src/game_io/game_cmd_queue_data_packet.cc'
--- src/game_io/game_cmd_queue_data_packet.cc 2014-07-03 19:26:30 +0000
+++ src/game_io/game_cmd_queue_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -33,7 +33,7 @@
void Game_Cmd_Queue_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader * const ol)
+ (FileSystem & fs, Game & game, MapMapObjectLoader * const ol)
{
try {
FileRead fr;
@@ -89,7 +89,7 @@
void Game_Cmd_Queue_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const os)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const os)
{
FileWrite fw;
=== modified file 'src/game_io/game_cmd_queue_data_packet.h'
--- src/game_io/game_cmd_queue_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_cmd_queue_data_packet.h 2014-07-28 18:15:26 +0000
@@ -31,8 +31,8 @@
* a game for a user (for example in a listbox)
*/
struct Game_Cmd_Queue_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
};
}
=== modified file 'src/game_io/game_data_packet.h'
--- src/game_io/game_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_data_packet.h 2014-07-28 18:15:26 +0000
@@ -27,8 +27,8 @@
namespace Widelands {
class Game;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
/*
========================================
@@ -40,8 +40,8 @@
*/
struct Game_Data_Packet {
virtual ~Game_Data_Packet() {}
- virtual void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) = 0;
- virtual void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) = 0;
+ virtual void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) = 0;
+ virtual void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) = 0;
};
}
=== modified file 'src/game_io/game_game_class_data_packet.cc'
--- src/game_io/game_game_class_data_packet.cc 2014-05-11 07:53:49 +0000
+++ src/game_io/game_game_class_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -30,7 +30,7 @@
void Game_Game_Class_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader *)
+ (FileSystem & fs, Game & game, MapMapObjectLoader *)
{
try {
FileRead fr;
@@ -51,7 +51,7 @@
* Write Function
*/
void Game_Game_Class_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const)
{
FileWrite fw;
=== modified file 'src/game_io/game_game_class_data_packet.h'
--- src/game_io/game_game_class_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_game_class_data_packet.h 2014-07-28 18:15:26 +0000
@@ -29,8 +29,8 @@
* a game for a user (for example in a listbox)
*/
struct Game_Game_Class_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
};
}
=== modified file 'src/game_io/game_interactive_player_data_packet.cc'
--- src/game_io/game_interactive_player_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/game_io/game_interactive_player_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -35,7 +35,7 @@
void Game_Interactive_Player_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader *)
+ (FileSystem & fs, Game & game, MapMapObjectLoader *)
{
try {
FileRead fr;
@@ -89,7 +89,7 @@
* Write Function
*/
void Game_Interactive_Player_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const)
{
FileWrite fw;
=== modified file 'src/game_io/game_interactive_player_data_packet.h'
--- src/game_io/game_interactive_player_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_interactive_player_data_packet.h 2014-07-28 18:15:26 +0000
@@ -29,8 +29,8 @@
* player number and so on
*/
struct Game_Interactive_Player_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
};
}
=== modified file 'src/game_io/game_loader.cc'
--- src/game_io/game_loader.cc 2014-07-24 15:45:59 +0000
+++ src/game_io/game_loader.cc 2014-07-28 18:15:26 +0000
@@ -84,7 +84,7 @@
M.Read_Complete(m_game);
log("Game: Read_Complete took: %ums\n", timer.ms_since_last_query());
- Map_Map_Object_Loader * const mol = M.get_map_object_loader();
+ MapMapObjectLoader * const mol = M.get_map_object_loader();
log("Game: Reading Player Economies Info ... ");
{Game_Player_Economies_Data_Packet p; p.Read(m_fs, m_game, mol);}
@@ -110,9 +110,9 @@
(new Cmd_ExpireMessage
(m->sent() + duration, p, m_id));
}
- // Renew Map_Object connections
+ // Renew MapObject connections
if (m->serial() > 0) {
- Map_Object* mo = m_game.objects().get_object(m->serial());
+ MapObject* mo = m_game.objects().get_object(m->serial());
mo->removed.connect
(boost::bind(&Player::message_object_removed, player, m_id));
}
=== modified file 'src/game_io/game_map_data_packet.cc'
--- src/game_io/game_map_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/game_io/game_map_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -35,7 +35,7 @@
}
void Game_Map_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader * const)
+ (FileSystem & fs, Game & game, MapMapObjectLoader * const)
{
if (!fs.FileExists("map") || !fs.IsDirectory("map"))
throw game_data_error("no map");
@@ -60,7 +60,7 @@
void Game_Map_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const)
{
std::unique_ptr<FileSystem> mapfs
=== modified file 'src/game_io/game_map_data_packet.h'
--- src/game_io/game_map_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_map_data_packet.h 2014-07-28 18:15:26 +0000
@@ -36,18 +36,18 @@
/// Ensures that the world gets loaded but does not much more.
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
void Read_Complete(Game &); /// Loads the rest of the map.
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
- Map_Map_Object_Saver * get_map_object_saver () {return m_mos;}
- Map_Map_Object_Loader * get_map_object_loader() {return m_mol;}
+ MapMapObjectSaver * get_map_object_saver () {return m_mos;}
+ MapMapObjectLoader * get_map_object_loader() {return m_mol;}
private:
- Map_Map_Object_Saver * m_mos;
- Map_Map_Object_Loader * m_mol;
+ MapMapObjectSaver * m_mos;
+ MapMapObjectLoader * m_mol;
Map_Saver * m_wms;
WL_Map_Loader * m_wml;
};
=== modified file 'src/game_io/game_player_economies_data_packet.cc'
--- src/game_io/game_player_economies_data_packet.cc 2014-07-25 20:40:51 +0000
+++ src/game_io/game_player_economies_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -36,7 +36,7 @@
void Game_Player_Economies_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader *)
+ (FileSystem & fs, Game & game, MapMapObjectLoader *)
{
try {
const Map & map = game.map();
@@ -95,7 +95,7 @@
* Write Function
*/
void Game_Player_Economies_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const)
{
FileWrite fw;
=== modified file 'src/game_io/game_player_economies_data_packet.h'
--- src/game_io/game_player_economies_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_player_economies_data_packet.h 2014-07-28 18:15:26 +0000
@@ -28,8 +28,8 @@
* how many and which economies does a player have?
*/
struct Game_Player_Economies_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
};
}
=== modified file 'src/game_io/game_player_info_data_packet.cc'
--- src/game_io/game_player_info_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/game_io/game_player_info_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
void Game_Player_Info_Data_Packet::Read
- (FileSystem & fs, Game & game, Map_Map_Object_Loader *)
+ (FileSystem & fs, Game & game, MapMapObjectLoader *)
{
try {
FileRead fr;
@@ -98,7 +98,7 @@
void Game_Player_Info_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver *)
+ (FileSystem & fs, Game & game, MapMapObjectSaver *)
{
FileWrite fw;
=== modified file 'src/game_io/game_player_info_data_packet.h'
--- src/game_io/game_player_info_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_player_info_data_packet.h 2014-07-28 18:15:26 +0000
@@ -29,8 +29,8 @@
* a game for a user (for example in a listbox)
*/
struct Game_Player_Info_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
};
}
=== modified file 'src/game_io/game_preload_data_packet.cc'
--- src/game_io/game_preload_data_packet.cc 2014-07-17 13:26:23 +0000
+++ src/game_io/game_preload_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -46,7 +46,7 @@
void Game_Preload_Data_Packet::Read
- (FileSystem & fs, Game &, Map_Map_Object_Loader * const)
+ (FileSystem & fs, Game &, MapMapObjectLoader * const)
{
try {
Profile prof;
@@ -76,7 +76,7 @@
void Game_Preload_Data_Packet::Write
- (FileSystem & fs, Game & game, Map_Map_Object_Saver * const)
+ (FileSystem & fs, Game & game, MapMapObjectSaver * const)
{
Profile prof;
=== modified file 'src/game_io/game_preload_data_packet.h'
--- src/game_io/game_preload_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/game_io/game_preload_data_packet.h 2014-07-28 18:15:26 +0000
@@ -32,8 +32,8 @@
* a game for a user (for example in a listbox)
*/
struct Game_Preload_Data_Packet : public Game_Data_Packet {
- void Read (FileSystem &, Game &, Map_Map_Object_Loader * = nullptr) override;
- void Write(FileSystem &, Game &, Map_Map_Object_Saver * = nullptr) override;
+ void Read (FileSystem &, Game &, MapMapObjectLoader * = nullptr) override;
+ void Write(FileSystem &, Game &, MapMapObjectSaver * = nullptr) override;
char const * get_mapname() {return m_mapname.c_str();}
std::string get_background() {return m_background;}
=== modified file 'src/game_io/game_saver.cc'
--- src/game_io/game_saver.cc 2014-07-05 13:14:42 +0000
+++ src/game_io/game_saver.cc 2014-07-28 18:15:26 +0000
@@ -61,7 +61,7 @@
Game_Map_Data_Packet M; M.Write(m_fs, m_game, nullptr);
log("Game: Writing Map Data took %ums\n", timer.ms_since_last_query());
- Map_Map_Object_Saver * const mos = M.get_map_object_saver();
+ MapMapObjectSaver * const mos = M.get_map_object_saver();
log("Game: Writing Player Economies Info ... ");
{Game_Player_Economies_Data_Packet p; p.Write(m_fs, m_game, mos);}
=== modified file 'src/graphic/animation.cc'
--- src/graphic/animation.cc 2014-07-26 10:43:23 +0000
+++ src/graphic/animation.cc 2014-07-28 18:15:26 +0000
@@ -384,7 +384,7 @@
* @param optional No error if animations do not exist
*/
void DirAnimations::parse
- (Widelands::Map_Object_Descr & b,
+ (Widelands::MapObjectDescr & b,
const string & directory,
Profile & prof,
const string & name,
=== modified file 'src/graphic/diranimations.h'
--- src/graphic/diranimations.h 2014-07-05 16:41:51 +0000
+++ src/graphic/diranimations.h 2014-07-28 18:15:26 +0000
@@ -26,7 +26,7 @@
#include "logic/widelands.h"
-namespace Widelands {struct Map_Object_Descr;}
+namespace Widelands {struct MapObjectDescr;}
class Profile;
class Section;
@@ -38,7 +38,7 @@
uint32_t dir4 = 0, uint32_t dir5 = 0, uint32_t dir6 = 0);
void parse
- (Widelands::Map_Object_Descr &,
+ (Widelands::MapObjectDescr &,
const std::string & directory,
Profile &,
const std::string & name,
=== modified file 'src/graphic/render/gamerenderer.cc'
--- src/graphic/render/gamerenderer.cc 2014-07-26 09:48:21 +0000
+++ src/graphic/render/gamerenderer.cc 2014-07-28 18:15:26 +0000
@@ -159,7 +159,7 @@
const Player::Field & f_pl = m_player->fields()[map.get_index(coords[F], map.get_width())];
const Player * owner = owner_number[F] ? m_egbase->get_player(owner_number[F]) : nullptr;
if
- (const Map_Object_Descr * const map_object_descr =
+ (const MapObjectDescr * const map_object_descr =
f_pl.map_object_descr[TCoords<>::None])
{
if
@@ -170,10 +170,10 @@
uint32_t anim_idx;
try {
anim_idx = csinf.becomes->get_animation("build");
- } catch (Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (MapObjectDescr::Animation_Nonexistent &) {
try {
anim_idx = csinf.becomes->get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent) {
+ } catch (MapObjectDescr::Animation_Nonexistent) {
anim_idx = csinf.becomes->get_animation("idle");
}
}
@@ -201,7 +201,7 @@
uint32_t a;
try {
a = csinf.was->get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (MapObjectDescr::Animation_Nonexistent &) {
a = csinf.was->get_animation("idle");
}
m_dst->drawanimrect
@@ -209,18 +209,18 @@
}
assert(lines <= h);
m_dst->drawanimrect(pos[F], anim_idx, tanim, owner, Rect(Point(0, h - lines), w, lines));
- } else if (upcast(const Building_Descr, building, map_object_descr)) {
+ } else if (upcast(const BuildingDescr, building, map_object_descr)) {
// this is a building therefore we either draw unoccupied or idle animation
uint32_t pic;
try {
pic = building->get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (MapObjectDescr::Animation_Nonexistent &) {
pic = building->get_animation("idle");
}
m_dst->drawanim(pos[F], pic, 0, owner);
} else if (const uint32_t pic = map_object_descr->main_animation()) {
m_dst->drawanim(pos[F], pic, 0, owner);
- } else if (map_object_descr->type() == Map_Object_Type::FLAG) {
+ } else if (map_object_descr->type() == MapObjectType::FLAG) {
m_dst->drawanim(pos[F], owner->tribe().flag_animation(), 0, owner);
}
}
=== modified file 'src/graphic/rendertarget.cc'
--- src/graphic/rendertarget.cc 2014-07-25 13:45:18 +0000
+++ src/graphic/rendertarget.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
using Widelands::Coords;
using Widelands::FCoords;
using Widelands::Map;
-using Widelands::Map_Object_Descr;
+using Widelands::MapObjectDescr;
using Widelands::Player;
using Widelands::TCoords;
=== modified file 'src/logic/CMakeLists.txt'
--- src/logic/CMakeLists.txt 2014-07-21 10:08:29 +0000
+++ src/logic/CMakeLists.txt 2014-07-28 18:15:26 +0000
@@ -90,9 +90,9 @@
constructionsite.cc
constructionsite.h
cookie_priority_queue.h
- critter_bob.cc
- critter_bob.h
- critter_bob_program.h
+ critter.cc
+ critter.h
+ critter_program.h
description_maintainer.h
dismantlesite.cc
dismantlesite.h
=== modified file 'src/logic/battle.cc'
--- src/logic/battle.cc 2014-07-26 10:15:48 +0000
+++ src/logic/battle.cc 2014-07-28 18:15:26 +0000
@@ -35,16 +35,16 @@
namespace Widelands {
namespace {
-Battle_Descr g_Battle_Descr("battle", "Battle");
+BattleDescr g_battle_descr("battle", "Battle");
}
-const Battle_Descr& Battle::descr() const {
- return g_Battle_Descr;
+const BattleDescr& Battle::descr() const {
+ return g_battle_descr;
}
Battle::Battle ()
:
- Map_Object(&g_Battle_Descr),
+ MapObject(&g_battle_descr),
m_first(nullptr),
m_second(nullptr),
m_creationtime(0),
@@ -55,7 +55,7 @@
{}
Battle::Battle(Game & game, Soldier & First, Soldier & Second) :
- Map_Object (&g_Battle_Descr),
+ MapObject (&g_battle_descr),
m_first (&First),
m_second (&Second),
m_readyflags (0),
@@ -79,7 +79,7 @@
void Battle::init (Editor_Game_Base & egbase)
{
- Map_Object::init(egbase);
+ MapObject::init(egbase);
m_creationtime = egbase.get_gametime();
@@ -103,7 +103,7 @@
m_second = nullptr;
}
- Map_Object::cleanup(egbase);
+ MapObject::cleanup(egbase);
}
@@ -342,7 +342,7 @@
void Battle::Loader::load(FileRead & fr, uint8_t const version)
{
- Map_Object::Loader::load(fr);
+ MapObject::Loader::load(fr);
Battle & battle = get<Battle>();
@@ -361,7 +361,7 @@
{
Battle & battle = get<Battle>();
try {
- Map_Object::Loader::load_pointers();
+ MapObject::Loader::load_pointers();
if (m_first)
try {
battle.m_first = &mol().get<Soldier>(m_first);
@@ -380,12 +380,12 @@
}
void Battle::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Battle);
+ fw.Unsigned8(HeaderBattle);
fw.Unsigned8(BATTLE_SAVEGAME_VERSION);
- Map_Object::save(egbase, mos, fw);
+ MapObject::save(egbase, mos, fw);
fw.Signed32(m_creationtime);
fw.Unsigned8(m_readyflags);
@@ -398,8 +398,8 @@
}
-Map_Object::Loader * Battle::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * Battle::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
std::unique_ptr<Loader> loader(new Loader);
=== modified file 'src/logic/battle.h'
--- src/logic/battle.h 2014-07-26 10:43:23 +0000
+++ src/logic/battle.h 2014-07-28 18:15:26 +0000
@@ -24,16 +24,16 @@
namespace Widelands {
class Soldier;
-class Battle_Descr : public Map_Object_Descr {
+class BattleDescr : public MapObjectDescr {
public:
- Battle_Descr(char const* const _name, char const* const _descname)
- : Map_Object_Descr(Map_Object_Type::BATTLE, _name, _descname) {
+ BattleDescr(char const* const _name, char const* const _descname)
+ : MapObjectDescr(MapObjectType::BATTLE, _name, _descname) {
}
- ~Battle_Descr() override {
+ ~BattleDescr() override {
}
private:
- DISALLOW_COPY_AND_ASSIGN(Battle_Descr);
+ DISALLOW_COPY_AND_ASSIGN(BattleDescr);
};
/**
@@ -44,20 +44,20 @@
* Soldiers defined, the battle object must be destroyed as soon as there is no
* other Soldier to battle anymore.
*/
-class Battle : public Map_Object {
+class Battle : public MapObject {
public:
- const Battle_Descr& descr() const;
+ const BattleDescr& descr() const;
Battle(); // for loading an existing battle from a savegame
Battle(Game &, Soldier &, Soldier &); // to create a new battle in the game
- // Implements Map_Object.
+ // Implements MapObject.
void init(Editor_Game_Base &) override;
void cleanup(Editor_Game_Base &) override;
bool has_new_save_support() override {return true;}
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &);
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &);
// Cancel this battle immediately and schedule destruction.
void cancel(Game &, Soldier &);
@@ -79,7 +79,7 @@
void getBattleWork(Game &, Soldier &);
private:
- struct Loader : public Map_Object::Loader {
+ struct Loader : public MapObject::Loader {
virtual void load(FileRead &, uint8_t version);
void load_pointers() override;
=== modified file 'src/logic/bob.cc'
--- src/logic/bob.cc 2014-07-26 09:48:21 +0000
+++ src/logic/bob.cc 2014-07-28 18:15:26 +0000
@@ -32,7 +32,7 @@
#include "io/filewrite.h"
#include "logic/backtrace.h"
#include "logic/checkstep.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/findbob.h"
#include "logic/game.h"
#include "logic/game_data_error.h"
@@ -50,11 +50,11 @@
namespace Widelands {
-BobDescr::BobDescr(Map_Object_Type type, const std::string& init_name,
+BobDescr::BobDescr(MapObjectType type, const std::string& init_name,
const std::string& init_descname,
Tribe_Descr const* tribe)
:
- Map_Object_Descr(type, init_name, init_descname),
+ MapObjectDescr(type, init_name, init_descname),
owner_tribe_ (tribe)
{
}
@@ -70,7 +70,7 @@
uint32_t BobDescr::vision_range() const
{
if (owner_tribe_) {
- if (upcast(const Ship_Descr, ship, this))
+ if (upcast(const ShipDescr, ship, this))
return ship->vision_range();
return owner_tribe_->get_bob_vision_range();
}
@@ -97,7 +97,7 @@
Bob::Bob(const BobDescr & _descr) :
-Map_Object (&_descr),
+MapObject (&_descr),
m_owner (nullptr),
m_position (FCoords(Coords(0, 0), nullptr)), // not linked anywhere
m_linknext (nullptr),
@@ -120,7 +120,7 @@
{
if (m_position.field) {
molog
- ("Map_Object::~Map_Object: m_pos.field != 0, cleanup() not "
+ ("MapObject::~MapObject: m_pos.field != 0, cleanup() not "
"called!\n");
abort();
}
@@ -134,7 +134,7 @@
*/
void Bob::init(Editor_Game_Base & egbase)
{
- Map_Object::init(egbase);
+ MapObject::init(egbase);
if (upcast(Game, game, &egbase))
schedule_act(*game, 1);
@@ -161,7 +161,7 @@
m_linknext->m_linkpprev = m_linkpprev;
}
- Map_Object::cleanup(egbase);
+ MapObject::cleanup(egbase);
}
@@ -227,7 +227,7 @@
*/
void Bob::schedule_destroy(Game & game)
{
- Map_Object::schedule_destroy(game);
+ MapObject::schedule_destroy(game);
++m_actid; // to skip over any updates that may be scheduled
m_actscheduled = true;
}
@@ -239,7 +239,7 @@
*/
void Bob::schedule_act(Game & game, uint32_t tdelta)
{
- Map_Object::schedule_act(game, tdelta, m_actid);
+ MapObject::schedule_act(game, tdelta, m_actid);
m_actscheduled = true;
}
@@ -1073,7 +1073,7 @@
void Bob::Loader::load(FileRead & fr)
{
- Map_Object::Loader::load(fr);
+ MapObject::Loader::load(fr);
uint8_t version = fr.Unsigned8();
if (version != BOB_SAVEGAME_VERSION)
@@ -1148,7 +1148,7 @@
void Bob::Loader::load_pointers()
{
- Map_Object::Loader::load_pointers();
+ MapObject::Loader::load_pointers();
Bob & bob = get<Bob>();
for (uint32_t i = 0; i < bob.m_stack.size(); ++i) {
@@ -1156,7 +1156,7 @@
LoadState & loadstate = states[i];
if (loadstate.objvar1)
- state.objvar1 = &mol().get<Map_Object>(loadstate.objvar1);
+ state.objvar1 = &mol().get<MapObject>(loadstate.objvar1);
if (state.route)
state.route->load_pointers(loadstate.route, mol());
@@ -1165,7 +1165,7 @@
void Bob::Loader::load_finish()
{
- Map_Object::Loader::load_finish();
+ MapObject::Loader::load_finish();
// Care about new mapobject saving / loading - map objects don't get a task,
// if created in the editor, so we give them one here.
@@ -1194,9 +1194,9 @@
}
void Bob::save
- (Editor_Game_Base & eg, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & eg, MapMapObjectSaver & mos, FileWrite & fw)
{
- Map_Object::save(eg, mos, fw);
+ MapObject::save(eg, mos, fw);
fw.Unsigned8(BOB_SAVEGAME_VERSION);
@@ -1224,7 +1224,7 @@
fw.Signed32(state.ivar1);
fw.Signed32(state.ivar2);
fw.Signed32(state.ivar3);
- if (const Map_Object * obj = state.objvar1.get(eg)) {
+ if (const MapObject * obj = state.objvar1.get(eg)) {
fw.Unsigned32(mos.get_object_file_index(*obj));
} else {
fw.Unsigned32(0);
=== modified file 'src/logic/bob.h'
--- src/logic/bob.h 2014-07-26 10:43:23 +0000
+++ src/logic/bob.h 2014-07-28 18:15:26 +0000
@@ -51,11 +51,11 @@
class Bob;
// Description for the Bob class.
-class BobDescr : public Map_Object_Descr {
+class BobDescr : public MapObjectDescr {
public:
friend struct Map_Bobdata_Data_Packet;
- BobDescr(Map_Object_Type type,
+ BobDescr(MapObjectType type,
const std::string& init_name,
const std::string& init_descname,
Tribe_Descr const* tribe);
@@ -150,7 +150,7 @@
* To this end, a task may have a \ref Task::pop method. If this method
* exists, it is always called just before the task is popped from the stack.
*/
-class Bob : public Map_Object {
+class Bob : public MapObject {
public:
friend class Map;
friend struct Map_Bobdata_Data_Packet;
@@ -381,7 +381,7 @@
// saving and loading
protected:
- struct Loader : public Map_Object::Loader {
+ struct Loader : public MapObject::Loader {
public:
Loader();
@@ -405,7 +405,7 @@
public:
bool has_new_save_support() override {return true;}
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
// Pure Bobs cannot be loaded
};
=== modified file 'src/logic/building.cc'
--- src/logic/building.cc 2014-07-26 10:57:26 +0000
+++ src/logic/building.cc 2014-07-28 18:15:26 +0000
@@ -51,12 +51,12 @@
static const int32_t BUILDING_LEAVE_INTERVAL = 1000;
-Building_Descr::Building_Descr
- (const Map_Object_Type type, char const * const _name, char const * const _descname,
+BuildingDescr::BuildingDescr
+ (const MapObjectType type, char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _descr)
:
- Map_Object_Descr(type, _name, _descname),
+ MapObjectDescr(type, _name, _descname),
m_tribe (_descr),
m_buildable (true),
m_icon (nullptr),
@@ -109,7 +109,7 @@
// Merge the enhancements workarea info into this building's
// workarea info.
- const Building_Descr * tmp_enhancement =
+ const BuildingDescr * tmp_enhancement =
tribe().get_building_descr(en_i);
for (std::pair<uint32_t, std::set<std::string>> area : tmp_enhancement->m_workarea_info)
{
@@ -174,7 +174,7 @@
}
-Building & Building_Descr::create
+Building & BuildingDescr::create
(Editor_Game_Base & egbase,
Player & owner,
Coords const pos,
@@ -198,7 +198,7 @@
}
-int32_t Building_Descr::suitability(const Map &, FCoords const fc) const {
+int32_t BuildingDescr::suitability(const Map &, FCoords const fc) const {
return m_size <= (fc.field->nodecaps() & Widelands::BUILDCAPS_SIZEMASK);
}
@@ -207,7 +207,7 @@
*
* \return the radius of the conquered area.
*/
-uint32_t Building_Descr::get_conquers() const
+uint32_t BuildingDescr::get_conquers() const
{
return 0;
}
@@ -217,7 +217,7 @@
* \return the radius (in number of fields) of the area seen by this
* building.
*/
-uint32_t Building_Descr::vision_range() const
+uint32_t BuildingDescr::vision_range() const
{
return m_vision_range ? m_vision_range : get_conquers() + 4;
}
@@ -228,7 +228,7 @@
Called whenever building graphics need to be loaded.
===============
*/
-void Building_Descr::load_graphics()
+void BuildingDescr::load_graphics()
{
if (!m_icon_fname.empty())
m_icon = g_gr->images().get(m_icon_fname);
@@ -239,13 +239,13 @@
Create a construction site for this type of building
===============
*/
-Building & Building_Descr::create_constructionsite() const
+Building & BuildingDescr::create_constructionsite() const
{
- Building_Descr const * const descr =
+ BuildingDescr const * const descr =
m_tribe.get_building_descr
(m_tribe.safe_building_index("constructionsite"));
ConstructionSite & csite =
- ref_cast<ConstructionSite, Map_Object>(descr->create_object());
+ ref_cast<ConstructionSite, MapObject>(descr->create_object());
csite.set_building(*this);
return csite;
@@ -260,7 +260,7 @@
==============================
*/
-Building::Building(const Building_Descr & building_descr) :
+Building::Building(const BuildingDescr & building_descr) :
PlayerImmovable(building_descr),
m_optionswindow(nullptr),
m_flag (nullptr),
@@ -336,7 +336,7 @@
*/
uint32_t Building::get_playercaps() const {
uint32_t caps = 0;
- const Building_Descr & tmp_descr = descr();
+ const BuildingDescr & tmp_descr = descr();
if (tmp_descr.is_destructible()) {
caps |= PCap_Bulldoze;
if (tmp_descr.is_buildable() || tmp_descr.is_enhanced())
=== modified file 'src/logic/building.h'
--- src/logic/building.h 2014-07-26 10:57:26 +0000
+++ src/logic/building.h 2014-07-28 18:15:26 +0000
@@ -58,14 +58,14 @@
/*
* Common to all buildings!
*/
-struct Building_Descr : public Map_Object_Descr {
+struct BuildingDescr : public MapObjectDescr {
typedef std::vector<Building_Index> FormerBuildings;
- Building_Descr
- (Map_Object_Type type, char const * _name, char const * _descname,
+ BuildingDescr
+ (MapObjectType type, char const * _name, char const * _descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &);
- ~Building_Descr() override {}
+ ~BuildingDescr() override {}
bool is_buildable () const {return m_buildable;}
bool is_destructible() const {return m_destructible;}
@@ -155,15 +155,15 @@
// for migration, 0 is the default, meaning get_conquers() + 4
uint32_t m_vision_range;
- DISALLOW_COPY_AND_ASSIGN(Building_Descr);
+ DISALLOW_COPY_AND_ASSIGN(BuildingDescr);
};
class Building : public PlayerImmovable {
- friend struct Building_Descr;
+ friend struct BuildingDescr;
friend class Map_Buildingdata_Data_Packet;
- MO_DESCR(Building_Descr)
+ MO_DESCR(BuildingDescr)
public:
// Player capabilities: which commands can a player issue for this building?
@@ -176,7 +176,7 @@
typedef std::vector<Building_Index> FormerBuildings;
public:
- Building(const Building_Descr &);
+ Building(const BuildingDescr &);
virtual ~Building();
void load_finish(Editor_Game_Base &) override;
=== modified file 'src/logic/carrier.cc'
--- src/logic/carrier.cc 2014-07-25 18:08:48 +0000
+++ src/logic/carrier.cc 2014-07-28 18:15:26 +0000
@@ -617,7 +617,7 @@
}
void Carrier::do_save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
Worker::do_save(egbase, mos, fw);
@@ -628,6 +628,6 @@
/**
* Create a new carrier
*/
-Bob & Carrier_Descr::create_object() const {return *new Carrier(*this);}
+Bob & CarrierDescr::create_object() const {return *new Carrier(*this);}
}
=== modified file 'src/logic/carrier.h'
--- src/logic/carrier.h 2014-07-26 10:43:23 +0000
+++ src/logic/carrier.h 2014-07-28 18:15:26 +0000
@@ -25,24 +25,24 @@
namespace Widelands {
-struct Carrier_Descr : public Worker_Descr {
- Carrier_Descr(char const* const _name,
+struct CarrierDescr : public WorkerDescr {
+ CarrierDescr(char const* const _name,
char const* const _descname,
const std::string& directory,
Profile& prof,
Section& global_s,
const Tribe_Descr& _tribe)
:
- Worker_Descr(Map_Object_Type::CARRIER, _name, _descname, directory, prof, global_s, _tribe)
+ WorkerDescr(MapObjectType::CARRIER, _name, _descname, directory, prof, global_s, _tribe)
{
}
- ~Carrier_Descr() override {}
+ ~CarrierDescr() override {}
protected:
Bob & create_object() const override;
private:
- DISALLOW_COPY_AND_ASSIGN(Carrier_Descr);
+ DISALLOW_COPY_AND_ASSIGN(CarrierDescr);
};
/**
@@ -51,9 +51,9 @@
struct Carrier : public Worker {
friend struct Map_Bobdata_Data_Packet;
- MO_DESCR(Carrier_Descr)
+ MO_DESCR(CarrierDescr)
- Carrier(const Carrier_Descr & carrier_descr)
+ Carrier(const CarrierDescr & carrier_descr)
: Worker(carrier_descr), m_promised_pickup_to(-1)
{}
virtual ~Carrier() {}
@@ -110,7 +110,7 @@
public:
virtual void do_save
- (Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ (Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
};
}
=== modified file 'src/logic/cmd_calculate_statistics.cc'
--- src/logic/cmd_calculate_statistics.cc 2014-07-05 14:22:44 +0000
+++ src/logic/cmd_calculate_statistics.cc 2014-07-28 18:15:26 +0000
@@ -36,7 +36,7 @@
#define CMD_CALCULATE_STATISTICS_VERSION 1
void Cmd_CalculateStatistics::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -50,7 +50,7 @@
}
}
void Cmd_CalculateStatistics::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(CMD_CALCULATE_STATISTICS_VERSION);
GameLogicCommand::Write(fw, egbase, mos);
=== modified file 'src/logic/cmd_calculate_statistics.h'
--- src/logic/cmd_calculate_statistics.h 2014-07-26 10:43:23 +0000
+++ src/logic/cmd_calculate_statistics.h 2014-07-28 18:15:26 +0000
@@ -33,8 +33,8 @@
GameLogicCommand(_duetime) {}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_CALCULATE_STATISTICS;}
void execute(Game &) override;
=== modified file 'src/logic/cmd_incorporate.cc'
--- src/logic/cmd_incorporate.cc 2014-06-08 21:47:45 +0000
+++ src/logic/cmd_incorporate.cc 2014-07-28 18:15:26 +0000
@@ -29,7 +29,7 @@
namespace Widelands {
void Cmd_Incorporate::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -51,7 +51,7 @@
void Cmd_Incorporate::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(CMD_INCORPORATE_VERSION);
=== modified file 'src/logic/cmd_incorporate.h'
--- src/logic/cmd_incorporate.h 2014-07-26 10:43:23 +0000
+++ src/logic/cmd_incorporate.h 2014-07-28 18:15:26 +0000
@@ -35,8 +35,8 @@
void execute (Game & game) override {worker->incorporate(game);}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_INCORPORATE;}
=== modified file 'src/logic/cmd_luacoroutine.cc'
--- src/logic/cmd_luacoroutine.cc 2014-07-11 22:53:34 +0000
+++ src/logic/cmd_luacoroutine.cc 2014-07-28 18:15:26 +0000
@@ -59,7 +59,7 @@
}
#define CMD_LUACOROUTINE_VERSION 3
-void Cmd_LuaCoroutine::Read(FileRead& fr, Editor_Game_Base& egbase, Map_Map_Object_Loader& mol) {
+void Cmd_LuaCoroutine::Read(FileRead& fr, Editor_Game_Base& egbase, MapMapObjectLoader& mol) {
try {
uint16_t const packet_version = fr.Unsigned16();
if (packet_version == CMD_LUACOROUTINE_VERSION) {
@@ -79,7 +79,7 @@
}
}
void Cmd_LuaCoroutine::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(CMD_LUACOROUTINE_VERSION);
GameLogicCommand::Write(fw, egbase, mos);
=== modified file 'src/logic/cmd_luacoroutine.h'
--- src/logic/cmd_luacoroutine.h 2014-07-26 10:43:23 +0000
+++ src/logic/cmd_luacoroutine.h 2014-07-28 18:15:26 +0000
@@ -38,8 +38,8 @@
}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_LUACOROUTINE;}
=== modified file 'src/logic/cmd_luascript.cc'
--- src/logic/cmd_luascript.cc 2014-06-18 13:20:33 +0000
+++ src/logic/cmd_luascript.cc 2014-07-28 18:15:26 +0000
@@ -46,7 +46,7 @@
#define CMD_LUASCRIPT_VERSION 1
void Cmd_LuaScript::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -61,7 +61,7 @@
}
}
void Cmd_LuaScript::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(CMD_LUASCRIPT_VERSION);
GameLogicCommand::Write(fw, egbase, mos);
=== modified file 'src/logic/cmd_luascript.h'
--- src/logic/cmd_luascript.h 2014-07-26 10:43:23 +0000
+++ src/logic/cmd_luascript.h 2014-07-28 18:15:26 +0000
@@ -33,8 +33,8 @@
GameLogicCommand(_duetime), script_(script) {}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_LUASCRIPT;}
=== modified file 'src/logic/cmd_queue.cc'
--- src/logic/cmd_queue.cc 2014-07-26 16:37:37 +0000
+++ src/logic/cmd_queue.cc 2014-07-28 18:15:26 +0000
@@ -153,7 +153,7 @@
#else
Editor_Game_Base &,
#endif
- Map_Map_Object_Saver &)
+ MapMapObjectSaver &)
{
// First version
fw.Unsigned16(BASE_CMD_VERSION);
@@ -169,7 +169,7 @@
* \note This function must be called by deriving objects that override it.
*/
void GameLogicCommand::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader &)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader &)
{
try {
uint16_t const packet_version = fr.Unsigned16();
=== modified file 'src/logic/cmd_queue.h'
--- src/logic/cmd_queue.h 2014-07-15 17:29:28 +0000
+++ src/logic/cmd_queue.h 2014-07-28 18:15:26 +0000
@@ -35,8 +35,8 @@
namespace Widelands {
class Editor_Game_Base;
-struct Map_Map_Object_Saver;
-class Map_Map_Object_Loader;
+struct MapMapObjectSaver;
+class MapMapObjectLoader;
// Define here all the possible users
#define SENDER_MAPOBJECT 0
@@ -111,9 +111,9 @@
// Write these commands to a file (for savegames)
virtual void Write
- (FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &);
+ (FileWrite &, Editor_Game_Base &, MapMapObjectSaver &);
virtual void Read
- (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &);
+ (FileRead &, Editor_Game_Base &, MapMapObjectLoader &);
};
class Cmd_Queue {
=== modified file 'src/logic/constructionsite.cc'
--- src/logic/constructionsite.cc 2014-07-26 10:15:48 +0000
+++ src/logic/constructionsite.cc 2014-07-28 18:15:26 +0000
@@ -42,14 +42,14 @@
namespace Widelands {
-ConstructionSite_Descr::ConstructionSite_Descr
+ConstructionSiteDescr::ConstructionSiteDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe)
:
- Building_Descr(Map_Object_Type::CONSTRUCTIONSITE, _name, _descname, directory, prof, global_s, _tribe)
+ BuildingDescr(MapObjectType::CONSTRUCTIONSITE, _name, _descname, directory, prof, global_s, _tribe)
{
- add_attribute(Map_Object::CONSTRUCTIONSITE);
+ add_attribute(MapObject::CONSTRUCTIONSITE);
{ // animation when a worker entered the site
Section & sec = prof.get_safe_section("idle_with_worker");
@@ -60,7 +60,7 @@
}
-Building & ConstructionSite_Descr::create_object() const {
+Building & ConstructionSiteDescr::create_object() const {
return *new ConstructionSite(*this);
}
@@ -74,7 +74,7 @@
*/
-ConstructionSite::ConstructionSite(const ConstructionSite_Descr & cs_descr) :
+ConstructionSite::ConstructionSite(const ConstructionSiteDescr & cs_descr) :
Partially_Finished_Building (cs_descr),
m_fetchfromflag (0),
m_builder_idle (false)
@@ -118,7 +118,7 @@
Set the type of building we're going to build
===============
*/
-void ConstructionSite::set_building(const Building_Descr & building_descr) {
+void ConstructionSite::set_building(const BuildingDescr & building_descr) {
Partially_Finished_Building::set_building(building_descr);
m_info.becomes = &building_descr;
@@ -137,7 +137,7 @@
if (!m_old_buildings.empty()) {
// Enhancement
Building_Index was_index = m_old_buildings.back();
- const Building_Descr* was_descr = descr().tribe().get_building_descr(was_index);
+ const BuildingDescr* was_descr = descr().tribe().get_building_descr(was_index);
m_info.was = was_descr;
buildcost = &m_building->enhancement_cost();
} else {
@@ -369,10 +369,10 @@
uint32_t cur_frame;
try {
anim_idx = building().get_animation("build");
- } catch (Map_Object_Descr::Animation_Nonexistent&) {
+ } catch (MapObjectDescr::Animation_Nonexistent&) {
try {
anim_idx = building().get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent) {
+ } catch (MapObjectDescr::Animation_Nonexistent) {
anim_idx = building().get_animation("idle");
}
}
@@ -396,13 +396,13 @@
dst.drawanimrect(pos, anim_idx, tanim - FRAME_LENGTH, get_owner(), Rect(Point(0, 0), w, h - lines));
else if (!m_old_buildings.empty()) {
Building_Index prev_idx = m_old_buildings.back();
- const Building_Descr* prev_building = descr().tribe().get_building_descr(prev_idx);
+ const BuildingDescr* prev_building = descr().tribe().get_building_descr(prev_idx);
// Is the first picture but there was another building here before,
// get its most fitting picture and draw it instead.
uint32_t prev_building_anim_idx;
try {
prev_building_anim_idx = prev_building->get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (MapObjectDescr::Animation_Nonexistent &) {
prev_building_anim_idx = prev_building->get_animation("idle");
}
const Animation& prev_building_anim = g_gr->animations().get_animation(prev_building_anim_idx);
=== modified file 'src/logic/constructionsite.h'
--- src/logic/constructionsite.h 2014-07-26 10:43:23 +0000
+++ src/logic/constructionsite.h 2014-07-28 18:15:26 +0000
@@ -43,24 +43,24 @@
A construction site has one (or more) input wares types, each with an
associated store.
-Note that the ConstructionSite_Descr class is mostly a dummy class.
+Note that the ConstructionSiteDescr class is mostly a dummy class.
The ConstructionSite is derived from Building so that it fits in more cleanly
with the transport and Flag code.
-Every tribe has exactly one ConstructionSite_Descr.
+Every tribe has exactly one ConstructionSiteDescr.
The ConstructionSite's idling animation is the basic construction site marker.
*/
-struct ConstructionSite_Descr : public Building_Descr {
- ConstructionSite_Descr
+struct ConstructionSiteDescr : public BuildingDescr {
+ ConstructionSiteDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr & tribe);
- ~ConstructionSite_Descr() override {}
+ ~ConstructionSiteDescr() override {}
Building & create_object() const override;
private:
- DISALLOW_COPY_AND_ASSIGN(ConstructionSite_Descr);
+ DISALLOW_COPY_AND_ASSIGN(ConstructionSiteDescr);
};
class ConstructionSite : public Partially_Finished_Building {
@@ -68,10 +68,10 @@
static const uint32_t CONSTRUCTIONSITE_STEP_TIME = 30000;
- MO_DESCR(ConstructionSite_Descr)
+ MO_DESCR(ConstructionSiteDescr)
public:
- ConstructionSite(const ConstructionSite_Descr & descr);
+ ConstructionSite(const ConstructionSiteDescr & descr);
std::string get_statistics_string() override;
@@ -79,8 +79,8 @@
WaresQueue & waresqueue(Ware_Index) override;
- void set_building(const Building_Descr &) override;
- const Building_Descr & building() const {return *m_building;}
+ void set_building(const BuildingDescr &) override;
+ const BuildingDescr & building() const {return *m_building;}
void init (Editor_Game_Base &) override;
void cleanup(Editor_Game_Base &) override;
=== renamed file 'src/logic/critter_bob.cc' => 'src/logic/critter.cc'
--- src/logic/critter_bob.cc 2014-07-26 09:48:21 +0000
+++ src/logic/critter.cc 2014-07-28 18:15:26 +0000
@@ -17,7 +17,7 @@
*
*/
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include <cstdio>
#include <memory>
@@ -29,7 +29,7 @@
#include "helper.h"
#include "io/fileread.h"
#include "io/filewrite.h"
-#include "logic/critter_bob_program.h"
+#include "logic/critter_program.h"
#include "logic/field.h"
#include "logic/game.h"
#include "logic/game_data_error.h"
@@ -63,7 +63,7 @@
// Sets the dir animations in 'anims' with the animations
// '<prefix>_(ne|e|se|sw|w|nw)' which must be defined in 'mo'.
-void assign_diranimation(DirAnimations* anims, Map_Object_Descr& mo, const std::string& prefix) {
+void assign_diranimation(DirAnimations* anims, MapObjectDescr& mo, const std::string& prefix) {
static char const* const dirstrings[6] = {"ne", "e", "se", "sw", "w", "nw"};
for (int32_t dir = 1; dir <= 6; ++dir) {
anims->set_animation(dir, mo.get_animation(prefix + std::string("_") + dirstrings[dir - 1]));
@@ -72,18 +72,18 @@
} // namespace
-void Critter_BobProgram::parse(const std::vector<std::string>& lines) {
+void CritterProgram::parse(const std::vector<std::string>& lines) {
for (const std::string& line : lines) {
try {
const std::vector<std::string> cmd(split_string(line, " \t\r\n"));
if (cmd.empty())
continue;
- Critter_BobAction act;
+ CritterAction act;
if (cmd[0] == "remove") {
if (cmd.size() != 1)
throw wexception("Usage: remove");
- act.function = &Critter_Bob::run_remove;
+ act.function = &Critter::run_remove;
} else {
throw wexception("unknown command type \"%s\"", cmd[0].c_str());
}
@@ -113,8 +113,8 @@
==============================
*/
-bool Critter_Bob::run_remove
- (Game & game, State & state, const Critter_BobAction &)
+bool Critter::run_remove
+ (Game & game, State & state, const CritterAction &)
{
++state.ivar1;
// Bye, bye cruel world
@@ -131,14 +131,14 @@
===========================================================================
*/
-Critter_Bob_Descr::Critter_Bob_Descr(char const* const _name,
+CritterDescr::CritterDescr(char const* const _name,
char const* const _descname,
const std::string& directory,
Profile& prof,
Section& global_s,
Tribe_Descr & _tribe)
:
- BobDescr(Map_Object_Type::CRITTER, _name, _descname, &_tribe)
+ BobDescr(MapObjectType::CRITTER, _name, _descname, &_tribe)
{
{ // global options
Section & idle_s = prof.get_safe_section("idle");
@@ -163,12 +163,12 @@
std::transform
(program_name.begin(), program_name.end(), program_name.begin(),
tolower);
- Critter_BobProgram * prog = nullptr;
+ CritterProgram * prog = nullptr;
try {
if (m_programs.count(program_name))
throw wexception("this program has already been declared");
- prog = new Critter_BobProgram(v->get_string());
+ prog = new CritterProgram(v->get_string());
std::vector<std::string> lines(section_to_strings(&prof.get_safe_section(program_name)));
prog->parse(lines);
m_programs[program_name] = prog;
@@ -180,8 +180,8 @@
}
}
-Critter_Bob_Descr::Critter_Bob_Descr(const LuaTable& table)
- : BobDescr(Map_Object_Type::CRITTER, table.get_string("name"),
+CritterDescr::CritterDescr(const LuaTable& table)
+ : BobDescr(MapObjectType::CRITTER, table.get_string("name"),
table.get_string("descname"),
nullptr) // Can only handle world critters.
{
@@ -199,7 +199,7 @@
std::unique_ptr<LuaTable> programs = table.get_table("programs");
for (const std::string& program_name : programs->keys<std::string>()) {
try {
- std::unique_ptr<Critter_BobProgram> prog(new Critter_BobProgram(program_name));
+ std::unique_ptr<CritterProgram> prog(new CritterProgram(program_name));
prog->parse(programs->get_table(program_name)->array_entries<std::string>());
m_programs[program_name] = prog.release();
} catch (const std::exception& e) {
@@ -208,13 +208,13 @@
}
}
-Critter_Bob_Descr::~Critter_Bob_Descr() {
- for (std::pair<std::string, Critter_BobProgram *> program : m_programs) {
+CritterDescr::~CritterDescr() {
+ for (std::pair<std::string, CritterProgram *> program : m_programs) {
delete program.second;
}
}
-bool Critter_Bob_Descr::is_swimming() const {
+bool CritterDescr::is_swimming() const {
const static uint32_t swimming_attribute = get_attribute_id("swimming");
return has_attribute(swimming_attribute);
}
@@ -225,7 +225,7 @@
Get a program from the workers description.
===============
*/
-Critter_BobProgram const * Critter_Bob_Descr::get_program
+CritterProgram const * CritterDescr::get_program
(const std::string & programname) const
{
Programs::const_iterator const it = m_programs.find(programname);
@@ -236,7 +236,7 @@
}
-uint32_t Critter_Bob_Descr::movecaps() const {
+uint32_t CritterDescr::movecaps() const {
return is_swimming() ? MOVECAPS_SWIM : MOVECAPS_WALK;
}
@@ -244,7 +244,7 @@
/*
==============================================================================
-class Critter_Bob
+class Critter
==============================================================================
*/
@@ -256,8 +256,8 @@
// wait up to 12 seconds between moves
#define CRITTER_MAX_WAIT_TIME_BETWEEN_WALK 2000
-Critter_Bob::Critter_Bob(const Critter_Bob_Descr & critter_bob_descr) :
-Bob(critter_bob_descr)
+Critter::Critter(const CritterDescr & critter_descr) :
+Bob(critter_descr)
{}
@@ -275,16 +275,16 @@
==============================
*/
-Bob::Task const Critter_Bob::taskProgram = {
+Bob::Task const Critter::taskProgram = {
"program",
- static_cast<Bob::Ptr>(&Critter_Bob::program_update),
+ static_cast<Bob::Ptr>(&Critter::program_update),
nullptr,
nullptr,
true
};
-void Critter_Bob::start_task_program
+void Critter::start_task_program
(Game & game, const std::string & programname)
{
push_task(game, taskProgram);
@@ -294,7 +294,7 @@
}
-void Critter_Bob::program_update(Game & game, State & state)
+void Critter::program_update(Game & game, State & state)
{
if (get_signal().size()) {
molog("[program]: Interrupted by signal '%s'\n", get_signal().c_str());
@@ -302,14 +302,14 @@
}
for (;;) {
- const Critter_BobProgram & program =
- ref_cast<Critter_BobProgram const, BobProgramBase const>
+ const CritterProgram & program =
+ ref_cast<CritterProgram const, BobProgramBase const>
(*state.program);
if (state.ivar1 >= program.get_size())
return pop_task(game);
- const Critter_BobAction & action = program[state.ivar1];
+ const CritterAction & action = program[state.ivar1];
if ((this->*(action.function))(game, state, action))
return;
@@ -327,15 +327,15 @@
==============================
*/
-Bob::Task const Critter_Bob::taskRoam = {
+Bob::Task const Critter::taskRoam = {
"roam",
- static_cast<Bob::Ptr>(&Critter_Bob::roam_update),
+ static_cast<Bob::Ptr>(&Critter::roam_update),
nullptr,
nullptr,
true
};
-void Critter_Bob::roam_update(Game & game, State & state)
+void Critter::roam_update(Game & game, State & state)
{
if (get_signal().size())
return pop_task(game);
@@ -362,13 +362,13 @@
idle_time_min + game.logic_rand() % idle_time_rnd);
}
-void Critter_Bob::init_auto_task(Game & game) {
+void Critter::init_auto_task(Game & game) {
push_task(game, taskRoam);
top_state().ivar1 = 0;
}
-Bob & Critter_Bob_Descr::create_object() const {
- return *new Critter_Bob(*this);
+Bob & CritterDescr::create_object() const {
+ return *new Critter(*this);
}
/*
@@ -381,26 +381,26 @@
#define CRITTER_SAVEGAME_VERSION 1
-Critter_Bob::Loader::Loader()
+Critter::Loader::Loader()
{
}
-const Bob::Task * Critter_Bob::Loader::get_task(const std::string & name)
+const Bob::Task * Critter::Loader::get_task(const std::string & name)
{
if (name == "roam") return &taskRoam;
if (name == "program") return &taskProgram;
return Bob::Loader::get_task(name);
}
-const BobProgramBase * Critter_Bob::Loader::get_program
+const BobProgramBase * Critter::Loader::get_program
(const std::string & name)
{
- Critter_Bob & critter = get<Critter_Bob>();
+ Critter & critter = get<Critter>();
return critter.descr().get_program(name);
}
-Map_Object::Loader* Critter_Bob::load(Editor_Game_Base& egbase,
- Map_Map_Object_Loader& mol,
+MapObject::Loader* Critter::load(Editor_Game_Base& egbase,
+ MapMapObjectLoader& mol,
FileRead& fr,
const OneWorldLegacyLookupTable& lookup_table) {
std::unique_ptr<Loader> loader(new Loader);
@@ -412,17 +412,17 @@
if (1 <= version && version <= CRITTER_SAVEGAME_VERSION) {
const std::string owner = fr.CString();
std::string critter_name = fr.CString();
- const Critter_Bob_Descr * descr = nullptr;
+ const CritterDescr * descr = nullptr;
if (owner == "world") {
critter_name = lookup_table.lookup_critter(critter_name);
descr =
- dynamic_cast<const Critter_Bob_Descr*>(egbase.world().get_bob_descr(critter_name));
+ dynamic_cast<const CritterDescr*>(egbase.world().get_bob_descr(critter_name));
} else {
egbase.manually_load_tribe(owner);
if (const Tribe_Descr * tribe = egbase.get_tribe(owner))
- descr = dynamic_cast<const Critter_Bob_Descr *>
+ descr = dynamic_cast<const CritterDescr *>
(tribe->get_bob_descr(critter_name));
}
@@ -441,10 +441,10 @@
return loader.release();
}
-void Critter_Bob::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+void Critter::save
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Critter);
+ fw.Unsigned8(HeaderCritter);
fw.Unsigned8(CRITTER_SAVEGAME_VERSION);
std::string owner =
=== renamed file 'src/logic/critter_bob.h' => 'src/logic/critter.h'
--- src/logic/critter_bob.h 2014-07-26 10:43:23 +0000
+++ src/logic/critter.h 2014-07-28 18:15:26 +0000
@@ -17,8 +17,8 @@
*
*/
-#ifndef WL_LOGIC_CRITTER_BOB_H
-#define WL_LOGIC_CRITTER_BOB_H
+#ifndef WL_LOGIC_CRITTER_H
+#define WL_LOGIC_CRITTER_H
#include "base/macros.h"
#include "logic/bob.h"
@@ -29,22 +29,22 @@
namespace Widelands {
-struct Critter_BobAction;
-struct Critter_BobProgram;
+struct CritterAction;
+struct CritterProgram;
//
// Description
//
-struct Critter_Bob_Descr : BobDescr {
- Critter_Bob_Descr
+struct CritterDescr : BobDescr {
+ CritterDescr
(char const* const _name,
char const* const _descname,
const std::string& directory,
Profile& prof,
Section& global_s,
Tribe_Descr & _tribe);
- Critter_Bob_Descr(const LuaTable&);
- ~Critter_Bob_Descr() override;
+ CritterDescr(const LuaTable&);
+ ~CritterDescr() override;
Bob & create_object() const override;
@@ -52,33 +52,33 @@
uint32_t movecaps() const override;
const DirAnimations & get_walk_anims() const {return m_walk_anims;}
- Critter_BobProgram const * get_program(const std::string &) const;
+ CritterProgram const * get_program(const std::string &) const;
private:
DirAnimations m_walk_anims;
- typedef std::map<std::string, Critter_BobProgram *> Programs;
+ typedef std::map<std::string, CritterProgram *> Programs;
Programs m_programs;
- DISALLOW_COPY_AND_ASSIGN(Critter_Bob_Descr);
+ DISALLOW_COPY_AND_ASSIGN(CritterDescr);
};
-class Critter_Bob : public Bob {
+class Critter : public Bob {
friend struct Map_Bobdata_Data_Packet;
- friend struct Critter_BobProgram;
+ friend struct CritterProgram;
- MO_DESCR(Critter_Bob_Descr)
+ MO_DESCR(CritterDescr)
public:
- Critter_Bob(const Critter_Bob_Descr &);
+ Critter(const CritterDescr &);
void init_auto_task(Game &) override;
void start_task_program(Game &, const std::string & name);
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
- static Map_Object::Loader*
- load(Editor_Game_Base&, Map_Map_Object_Loader&, FileRead&, const OneWorldLegacyLookupTable& lookup_table);
+ static MapObject::Loader*
+ load(Editor_Game_Base&, MapMapObjectLoader&, FileRead&, const OneWorldLegacyLookupTable& lookup_table);
protected:
struct Loader : Bob::Loader {
@@ -92,7 +92,7 @@
void roam_update (Game &, State &);
void program_update(Game &, State &);
- bool run_remove(Game &, State &, const Critter_BobAction &);
+ bool run_remove(Game &, State &, const CritterAction &);
static Task const taskRoam;
static Task const taskProgram;
@@ -101,4 +101,4 @@
}
-#endif // end of include guard: WL_LOGIC_CRITTER_BOB_H
+#endif // end of include guard: WL_LOGIC_CRITTER_H
=== renamed file 'src/logic/critter_bob_program.h' => 'src/logic/critter_program.h'
--- src/logic/critter_bob_program.h 2014-07-05 16:41:51 +0000
+++ src/logic/critter_program.h 2014-07-28 18:15:26 +0000
@@ -17,17 +17,17 @@
*
*/
-#ifndef WL_LOGIC_CRITTER_BOB_PROGRAM_H
-#define WL_LOGIC_CRITTER_BOB_PROGRAM_H
+#ifndef WL_LOGIC_CRITTER_PROGRAM_H
+#define WL_LOGIC_CRITTER_PROGRAM_H
#include "logic/bob.h"
namespace Widelands {
-struct Critter_BobAction {
+struct CritterAction {
typedef
- bool (Critter_Bob::*execute_t)
- (Game &, Bob::State &, const Critter_BobAction &);
+ bool (Critter::*execute_t)
+ (Game &, Bob::State &, const CritterAction &);
enum {
walkObject, // walk to objvar1
@@ -42,13 +42,13 @@
std::vector<std::string> sparamv;
};
-struct Critter_BobProgram : public BobProgramBase {
- Critter_BobProgram(const std::string & name) : m_name(name) {}
- virtual ~Critter_BobProgram() {}
+struct CritterProgram : public BobProgramBase {
+ CritterProgram(const std::string & name) : m_name(name) {}
+ virtual ~CritterProgram() {}
std::string get_name() const override {return m_name;}
int32_t get_size() const {return m_actions.size();}
- const Critter_BobAction & operator[] (size_t const idx) const {
+ const CritterAction & operator[] (size_t const idx) const {
assert(idx < m_actions.size());
return m_actions[idx];
}
@@ -57,9 +57,9 @@
private:
std::string m_name;
- std::vector<Critter_BobAction> m_actions;
+ std::vector<CritterAction> m_actions;
};
}
-#endif // end of include guard: WL_LOGIC_CRITTER_BOB_PROGRAM_H
+#endif // end of include guard: WL_LOGIC_CRITTER_PROGRAM_H
=== modified file 'src/logic/dismantlesite.cc'
--- src/logic/dismantlesite.cc 2014-07-26 09:48:21 +0000
+++ src/logic/dismantlesite.cc 2014-07-28 18:15:26 +0000
@@ -36,17 +36,17 @@
namespace Widelands {
-DismantleSite_Descr::DismantleSite_Descr
+DismantleSiteDescr::DismantleSiteDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe)
:
- Building_Descr(Map_Object_Type::DISMANTLESITE, _name, _descname, directory, prof, global_s, _tribe)
+ BuildingDescr(MapObjectType::DISMANTLESITE, _name, _descname, directory, prof, global_s, _tribe)
{
- add_attribute(Map_Object::Attribute::CONSTRUCTIONSITE); // Yep, this is correct.
+ add_attribute(MapObject::Attribute::CONSTRUCTIONSITE); // Yep, this is correct.
}
-Building & DismantleSite_Descr::create_object() const {
+Building & DismantleSiteDescr::create_object() const {
return *new DismantleSite(*this);
}
@@ -59,12 +59,12 @@
*/
-DismantleSite::DismantleSite(const DismantleSite_Descr & gdescr) :
+DismantleSite::DismantleSite(const DismantleSiteDescr & gdescr) :
Partially_Finished_Building(gdescr)
{}
DismantleSite::DismantleSite
- (const DismantleSite_Descr & gdescr, Editor_Game_Base & egbase, Coords const c,
+ (const DismantleSiteDescr & gdescr, Editor_Game_Base & egbase, Coords const c,
Player & plr, bool loading, Building::FormerBuildings & former_buildings)
:
Partially_Finished_Building(gdescr)
@@ -76,7 +76,7 @@
for (Building_Index former_idx : former_buildings) {
m_old_buildings.push_back(former_idx);
}
- const Building_Descr* cur_descr = owner().tribe().get_building_descr(m_old_buildings.back());
+ const BuildingDescr* cur_descr = owner().tribe().get_building_descr(m_old_buildings.back());
set_building(*cur_descr);
if (loading) {
@@ -135,7 +135,7 @@
{
for (Building_Index former_idx : building->get_former_buildings()) {
const std::map<Ware_Index, uint8_t> * return_wares;
- const Building_Descr* former_descr = building->descr().tribe().get_building_descr(former_idx);
+ const BuildingDescr* former_descr = building->descr().tribe().get_building_descr(former_idx);
if (former_idx != building->get_former_buildings().front()) {
return_wares = & former_descr->returned_wares_enhanced();
} else {
@@ -257,7 +257,7 @@
uint32_t anim_idx;
try {
anim_idx = m_building->get_animation("unoccupied");
- } catch (Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (MapObjectDescr::Animation_Nonexistent &) {
anim_idx = m_building->get_animation("idle");
}
const Animation& anim = g_gr->animations().get_animation(anim_idx);
=== modified file 'src/logic/dismantlesite.h'
--- src/logic/dismantlesite.h 2014-07-26 10:43:23 +0000
+++ src/logic/dismantlesite.h 2014-07-28 18:15:26 +0000
@@ -42,19 +42,19 @@
*/
class DismantleSite;
-struct DismantleSite_Descr : public Building_Descr {
- DismantleSite_Descr(char const* name,
+struct DismantleSiteDescr : public BuildingDescr {
+ DismantleSiteDescr(char const* name,
char const* descname,
const std::string& directory,
Profile&,
Section& global_s,
const Tribe_Descr& tribe);
- ~DismantleSite_Descr() override {}
+ ~DismantleSiteDescr() override {}
Building& create_object() const override;
private:
- DISALLOW_COPY_AND_ASSIGN(DismantleSite_Descr);
+ DISALLOW_COPY_AND_ASSIGN(DismantleSiteDescr);
};
class DismantleSite : public Partially_Finished_Building {
@@ -62,12 +62,12 @@
static const uint32_t DISMANTLESITE_STEP_TIME = 45000;
- MO_DESCR(DismantleSite_Descr)
+ MO_DESCR(DismantleSiteDescr)
public:
- DismantleSite(const DismantleSite_Descr & descr);
+ DismantleSite(const DismantleSiteDescr & descr);
DismantleSite
- (const DismantleSite_Descr & descr, Editor_Game_Base &,
+ (const DismantleSiteDescr & descr, Editor_Game_Base &,
Coords const, Player &, bool, Building::FormerBuildings & former_buildings);
std::string get_statistics_string() override;
=== modified file 'src/logic/editor_game_base.cc'
--- src/logic/editor_game_base.cc 2014-07-25 20:40:51 +0000
+++ src/logic/editor_game_base.cc 2014-07-28 18:15:26 +0000
@@ -198,7 +198,7 @@
}
}
void Editor_Game_Base::inform_players_about_immovable
- (Map_Index const i, Map_Object_Descr const * const descr)
+ (Map_Index const i, MapObjectDescr const * const descr)
{
if (!Road::IsRoadDescr(descr))
iterate_players_existing_const(plnum, MAX_PLAYERS, *this, p) {
@@ -332,11 +332,11 @@
Player & plr = player(owner);
const Tribe_Descr & tribe = plr.tribe();
- Building_Descr const * const descr =
+ BuildingDescr const * const descr =
tribe.get_building_descr
(tribe.safe_building_index("dismantlesite"));
- upcast(const DismantleSite_Descr, ds_descr, descr);
+ upcast(const DismantleSiteDescr, ds_descr, descr);
return
*new DismantleSite
@@ -398,7 +398,7 @@
Immovable & Editor_Game_Base::create_immovable
(Coords const c, uint32_t const idx, Tribe_Descr const * const tribe)
{
- const Immovable_Descr & descr =
+ const ImmovableDescr & descr =
*
(tribe ?
tribe->get_immovable_descr(idx)
=== modified file 'src/logic/editor_game_base.h'
--- src/logic/editor_game_base.h 2014-07-25 11:14:03 +0000
+++ src/logic/editor_game_base.h 2014-07-28 18:15:26 +0000
@@ -43,7 +43,7 @@
class Battle;
class Bob;
-struct Building_Descr;
+struct BuildingDescr;
class Immovable;
class Map;
struct Object_Manager;
@@ -153,7 +153,7 @@
return ibase_;
}
- // safe system for storing pointers to non-Map_Object C++ objects
+ // safe system for storing pointers to non-MapObject C++ objects
// unlike objects in the Object_Manager, these pointers need not be
// synchronized across the network, and they are not saved in savegames
uint32_t add_trackpointer(void*);
@@ -169,8 +169,8 @@
Tribe_Descr const* get_tribe(const std::string& name) const;
void inform_players_about_ownership(Map_Index, Player_Number);
- void inform_players_about_immovable(Map_Index, Map_Object_Descr const*);
- void inform_players_about_road(FCoords, Map_Object_Descr const*);
+ void inform_players_about_immovable(Map_Index, MapObjectDescr const*);
+ void inform_players_about_road(FCoords, MapObjectDescr const*);
void unconquer_area(Player_Area<Area<FCoords>>, Player_Number destroying_player = 0);
void conquer_area(Player_Area<Area<FCoords>>);
=== modified file 'src/logic/expedition_bootstrap.cc'
--- src/logic/expedition_bootstrap.cc 2014-07-14 10:45:44 +0000
+++ src/logic/expedition_bootstrap.cc 2014-07-28 18:15:26 +0000
@@ -240,7 +240,7 @@
cleanup(game);
}
-void ExpeditionBootstrap::save(FileWrite& fw, Game& game, Map_Map_Object_Saver& mos) {
+void ExpeditionBootstrap::save(FileWrite& fw, Game& game, MapMapObjectSaver& mos) {
// Expedition workers
fw.Unsigned8(workers_.size());
for (std::unique_ptr<ExpeditionWorker>& ew : workers_) {
@@ -262,7 +262,7 @@
void ExpeditionBootstrap::load
(uint32_t warehouse_packet_version, Warehouse& warehouse, FileRead& fr,
- Game& game, Map_Map_Object_Loader& mol)
+ Game& game, MapMapObjectLoader& mol)
{
assert(warehouse_packet_version >= 6);
=== modified file 'src/logic/expedition_bootstrap.h'
--- src/logic/expedition_bootstrap.h 2014-07-14 19:48:07 +0000
+++ src/logic/expedition_bootstrap.h 2014-07-28 18:15:26 +0000
@@ -31,7 +31,7 @@
class Economy;
class Editor_Game_Base;
class Game;
-class Map_Map_Object_Loader;
+class MapMapObjectLoader;
class PortDock;
class Request;
class WareInstance;
@@ -77,8 +77,8 @@
// packet, and there in the warehouse data packet.
void load
(uint32_t warehouse_packet_version, Warehouse& warehouse,
- FileRead& fr, Game& game, Map_Map_Object_Loader& mol);
- void save(FileWrite& fw, Game& game, Map_Map_Object_Saver& mos);
+ FileRead& fr, Game& game, MapMapObjectLoader& mol);
+ void save(FileWrite& fw, Game& game, MapMapObjectSaver& mos);
private:
struct ExpeditionWorker;
=== modified file 'src/logic/findbob.cc'
--- src/logic/findbob.cc 2014-07-23 14:58:01 +0000
+++ src/logic/findbob.cc 2014-07-28 18:15:26 +0000
@@ -44,12 +44,12 @@
bool FindBobShip::accept(Bob * bob) const
{
- return bob->descr().type() == Map_Object_Type::SHIP;
+ return bob->descr().type() == MapObjectType::SHIP;
}
bool FindBobCritter::accept(Bob * bob) const
{
- return bob->descr().type() == Map_Object_Type::CRITTER;
+ return bob->descr().type() == MapObjectType::CRITTER;
}
=== modified file 'src/logic/findimmovable.h'
--- src/logic/findimmovable.h 2014-07-23 14:58:01 +0000
+++ src/logic/findimmovable.h 2014-07-28 18:15:26 +0000
@@ -27,7 +27,7 @@
namespace Widelands {
struct BaseImmovable;
-struct Immovable_Descr;
+struct ImmovableDescr;
class Player;
struct FindImmovable {
@@ -94,12 +94,12 @@
int32_t m_min, m_max;
};
struct FindImmovableType {
- FindImmovableType(Map_Object_Type const type) : m_type(type) {}
+ FindImmovableType(MapObjectType const type) : m_type(type) {}
bool accept(const BaseImmovable &) const;
private:
- Map_Object_Type m_type;
+ MapObjectType m_type;
};
struct FindImmovableAttribute {
FindImmovableAttribute(uint32_t const attrib) : m_attrib(attrib) {}
@@ -127,11 +127,11 @@
bool accept(const BaseImmovable &) const;
};
struct FindImmovableByDescr {
- FindImmovableByDescr(const Immovable_Descr & _descr) : descr(_descr) {}
+ FindImmovableByDescr(const ImmovableDescr & _descr) : descr(_descr) {}
bool accept(const BaseImmovable &) const;
- const Immovable_Descr & descr;
+ const ImmovableDescr & descr;
};
struct FindFlagOf {
FindFlagOf(const FindImmovable & finder) : finder_(finder) {}
=== modified file 'src/logic/game.cc'
--- src/logic/game.cc 2014-07-26 10:15:48 +0000
+++ src/logic/game.cc 2014-07-28 18:15:26 +0000
@@ -999,7 +999,7 @@
++workerid)
if
(!
- dynamic_cast<Carrier_Descr const *>
+ dynamic_cast<CarrierDescr const *>
(tribe.get_worker_descr(workerid)))
wostock += eco->stock_worker(workerid);
}
=== modified file 'src/logic/immovable.cc'
--- src/logic/immovable.cc 2014-07-26 09:48:21 +0000
+++ src/logic/immovable.cc 2014-07-28 18:15:26 +0000
@@ -77,8 +77,8 @@
} // namespace
-BaseImmovable::BaseImmovable(const Map_Object_Descr & mo_descr) :
-Map_Object(&mo_descr)
+BaseImmovable::BaseImmovable(const MapObjectDescr & mo_descr) :
+MapObject(&mo_descr)
{}
@@ -137,7 +137,7 @@
ImmovableProgram::ImmovableProgram(const std::string& directory,
Profile& prof,
const std::string& _name,
- Immovable_Descr& immovable)
+ ImmovableDescr& immovable)
: m_name(_name) {
Section& program_s = prof.get_safe_section(_name.c_str());
while (Section::Value* const v = program_s.get_next_val()) {
@@ -179,7 +179,7 @@
ImmovableProgram::ImmovableProgram(const std::string& init_name,
const std::vector<std::string>& lines,
- Immovable_Descr* immovable)
+ ImmovableDescr* immovable)
: m_name(init_name) {
for (const std::string& line : lines) {
std::vector<std::string> parts;
@@ -214,7 +214,7 @@
/*
==============================================================================
-Immovable_Descr IMPLEMENTATION
+ImmovableDescr IMPLEMENTATION
==============================================================================
*/
@@ -222,12 +222,12 @@
/**
* Parse an immovable from its conf file.
*/
-Immovable_Descr::Immovable_Descr
+ImmovableDescr::ImmovableDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
Tribe_Descr const * const owner_tribe)
:
- Map_Object_Descr(Map_Object_Type::IMMOVABLE, _name, _descname),
+ MapObjectDescr(MapObjectType::IMMOVABLE, _name, _descname),
m_size (BaseImmovable::NONE),
m_owner_tribe (owner_tribe)
{
@@ -253,7 +253,7 @@
while (Section::Value const * const v = global_s.get_next_val("attrib")) {
attributes.emplace_back(v->get_string());
}
- add_attributes(attributes, {Map_Object::Attribute::RESI});
+ add_attributes(attributes, {MapObject::Attribute::RESI});
}
// parse the programs
@@ -283,14 +283,14 @@
}
}
-Immovable_Descr::Immovable_Descr(const LuaTable& table, const World& world) :
- Map_Object_Descr(
- Map_Object_Type::IMMOVABLE, table.get_string("name"), table.get_string("descname")),
+ImmovableDescr::ImmovableDescr(const LuaTable& table, const World& world) :
+ MapObjectDescr(
+ MapObjectType::IMMOVABLE, table.get_string("name"), table.get_string("descname")),
m_size(BaseImmovable::NONE),
m_owner_tribe(nullptr) // Can only parse world immovables for now.
{
m_size = string_to_size(table.get_string("size"));
- add_attributes(table.get_table("attributes")->array_entries<std::string>(), {Map_Object::Attribute::RESI});
+ add_attributes(table.get_table("attributes")->array_entries<std::string>(), {MapObject::Attribute::RESI});
std::unique_ptr<LuaTable> anims(table.get_table("animations"));
for (const std::string& animation : anims->keys<std::string>()) {
@@ -322,19 +322,19 @@
make_sure_default_program_is_there();
}
-const EditorCategory& Immovable_Descr::editor_category() const {
+const EditorCategory& ImmovableDescr::editor_category() const {
return *editor_category_;
}
-bool Immovable_Descr::has_terrain_affinity() const {
+bool ImmovableDescr::has_terrain_affinity() const {
return terrain_affinity_.get() != nullptr;
}
-const TerrainAffinity& Immovable_Descr::terrain_affinity() const {
+const TerrainAffinity& ImmovableDescr::terrain_affinity() const {
return *terrain_affinity_;
}
-void Immovable_Descr::make_sure_default_program_is_there() {
+void ImmovableDescr::make_sure_default_program_is_there() {
if (!m_programs.count("program")) { // default program
assert(is_animation_known("idle"));
char parameters[] = "idle";
@@ -346,7 +346,7 @@
/**
* Cleanup
*/
-Immovable_Descr::~Immovable_Descr()
+ImmovableDescr::~ImmovableDescr()
{
while (m_programs.size()) {
delete m_programs.begin()->second;
@@ -358,7 +358,7 @@
/**
* Find the program of the given name.
*/
-ImmovableProgram const * Immovable_Descr::get_program
+ImmovableProgram const * ImmovableDescr::get_program
(const std::string & program_name) const
{
Programs::const_iterator const it = m_programs.find(program_name);
@@ -375,7 +375,7 @@
/**
* Create an immovable of this type
*/
-Immovable & Immovable_Descr::create
+Immovable & ImmovableDescr::create
(Editor_Game_Base & egbase, Coords const coords) const
{
assert(this);
@@ -394,7 +394,7 @@
==============================
*/
-Immovable::Immovable(const Immovable_Descr & imm_descr) :
+Immovable::Immovable(const ImmovableDescr & imm_descr) :
BaseImmovable (imm_descr),
m_owner(nullptr),
m_anim (0),
@@ -616,7 +616,7 @@
{
BaseImmovable::Loader::load(fr);
- Immovable & imm = ref_cast<Immovable, Map_Object>(*get_object());
+ Immovable & imm = ref_cast<Immovable, MapObject>(*get_object());
if (version >= 5) {
Player_Number pn = fr.Unsigned8();
@@ -636,7 +636,7 @@
char const * const animname = fr.CString();
try {
imm.m_anim = imm.descr().get_animation(animname);
- } catch (const Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (const MapObjectDescr::Animation_Nonexistent &) {
imm.m_anim = imm.descr().main_animation();
log
("Warning: (%s) Animation \"%s\" not found, using animation %s).\n",
@@ -713,11 +713,11 @@
}
void Immovable::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
// This is in front because it is required to obtain the description
// necessary to create the Immovable
- fw.Unsigned8(header_Immovable);
+ fw.Unsigned8(HeaderImmovable);
fw.Unsigned8(IMMOVABLE_SAVEGAME_VERSION);
if (const Tribe_Descr * const tribe = descr().get_owner_tribe())
@@ -756,8 +756,8 @@
}
}
-Map_Object::Loader * Immovable::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol,
+MapObject::Loader * Immovable::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol,
FileRead & fr, const OneWorldLegacyLookupTable& lookup_table)
{
std::unique_ptr<Loader> loader(new Loader);
@@ -809,7 +809,7 @@
ImmovableProgram::Action::~Action() {}
-ImmovableProgram::ActAnimate::ActAnimate(char* parameters, Immovable_Descr& descr) {
+ImmovableProgram::ActAnimate::ActAnimate(char* parameters, ImmovableDescr& descr) {
try {
bool reached_end;
char * const animation_name = next_word(parameters, reached_end);
@@ -845,7 +845,7 @@
ImmovableProgram::ActPlayFX::ActPlayFX
- (const std::string & directory, char * parameters, const Immovable_Descr &)
+ (const std::string & directory, char * parameters, const ImmovableDescr &)
{
try {
bool reached_end;
@@ -880,7 +880,7 @@
ImmovableProgram::ActTransform::ActTransform
- (char * parameters, Immovable_Descr & descr)
+ (char * parameters, ImmovableDescr & descr)
{
try {
tribe = true;
@@ -955,7 +955,7 @@
ImmovableProgram::ActGrow::ActGrow
- (char * parameters, Immovable_Descr & descr)
+ (char * parameters, ImmovableDescr & descr)
{
if (!descr.has_terrain_affinity()) {
throw game_data_error(
@@ -1002,7 +1002,7 @@
void ImmovableProgram::ActGrow::execute(Game& game, Immovable& immovable) const {
const Map& map = game.map();
FCoords const f = map.get_fcoords(immovable.get_position());
- const Immovable_Descr& descr = immovable.descr();
+ const ImmovableDescr& descr = immovable.descr();
if (logic_rand_as_double(&game) <
probability_to_grow(descr.terrain_affinity(), f, map, game.world().terrains())) {
@@ -1017,7 +1017,7 @@
/**
* remove
*/
-ImmovableProgram::ActRemove::ActRemove(char * parameters, Immovable_Descr &)
+ImmovableProgram::ActRemove::ActRemove(char * parameters, ImmovableDescr &)
{
try {
if (*parameters) {
@@ -1044,7 +1044,7 @@
immovable.program_step(game);
}
-ImmovableProgram::ActSeed::ActSeed(char * parameters, Immovable_Descr & descr)
+ImmovableProgram::ActSeed::ActSeed(char * parameters, ImmovableDescr & descr)
{
try {
tribe = true;
@@ -1102,7 +1102,7 @@
{
const Map& map = game.map();
FCoords const f = map.get_fcoords(immovable.get_position());
- const Immovable_Descr& descr = immovable.descr();
+ const ImmovableDescr& descr = immovable.descr();
if (logic_rand_as_double(&game) <
probability_to_grow(descr.terrain_affinity(), f, map, game.world().terrains())) {
@@ -1133,7 +1133,7 @@
}
ImmovableProgram::ActConstruction::ActConstruction
- (char * parameters, Immovable_Descr & descr, const std::string & directory, Profile & prof)
+ (char * parameters, ImmovableDescr & descr, const std::string & directory, Profile & prof)
{
try {
if (!descr.get_owner_tribe())
@@ -1323,7 +1323,7 @@
/**
* Zero-initialize
*/
-PlayerImmovable::PlayerImmovable(const Map_Object_Descr & mo_descr) :
+PlayerImmovable::PlayerImmovable(const MapObjectDescr & mo_descr) :
BaseImmovable(mo_descr), m_owner(nullptr), m_economy(nullptr)
{}
@@ -1484,7 +1484,7 @@
}
}
-void PlayerImmovable::save(Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+void PlayerImmovable::save(Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
BaseImmovable::save(egbase, mos, fw);
=== modified file 'src/logic/immovable.h'
--- src/logic/immovable.h 2014-07-26 10:43:23 +0000
+++ src/logic/immovable.h 2014-07-28 18:15:26 +0000
@@ -69,7 +69,7 @@
*
* For more information, see the Map::recalc_* functions.
*/
-struct BaseImmovable : public Map_Object {
+struct BaseImmovable : public MapObject {
enum Size {
NONE = 0, ///< not robust (i.e. removable by building something over it)
SMALL, ///< small building or robust map element, including trees
@@ -77,7 +77,7 @@
BIG ///< big building
};
- BaseImmovable(const Map_Object_Descr &);
+ BaseImmovable(const MapObjectDescr &);
virtual int32_t get_size () const = 0;
virtual bool get_passable() const = 0;
@@ -108,15 +108,15 @@
/**
* Immovable represents a standard immovable such as trees or stones.
*/
-struct Immovable_Descr : public Map_Object_Descr {
+struct ImmovableDescr : public MapObjectDescr {
typedef std::map<std::string, ImmovableProgram *> Programs;
- Immovable_Descr
+ ImmovableDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
Tribe_Descr const * const);
- Immovable_Descr(const LuaTable&, const World&);
- ~Immovable_Descr() override;
+ ImmovableDescr(const LuaTable&, const World&);
+ ~ImmovableDescr() override;
int32_t get_size() const {return m_size;}
ImmovableProgram const * get_program(const std::string &) const;
@@ -143,7 +143,7 @@
int32_t m_size;
Programs m_programs;
- /// The tribe to which this Immovable_Descr belongs or 0 if it is a
+ /// The tribe to which this ImmovableDescr belongs or 0 if it is a
/// world immovable
const Tribe_Descr * const m_owner_tribe;
@@ -157,18 +157,18 @@
EditorCategory* editor_category_; // not owned.
std::unique_ptr<TerrainAffinity> terrain_affinity_;
- DISALLOW_COPY_AND_ASSIGN(Immovable_Descr);
+ DISALLOW_COPY_AND_ASSIGN(ImmovableDescr);
};
class Immovable : public BaseImmovable {
- friend struct Immovable_Descr;
+ friend struct ImmovableDescr;
friend struct ImmovableProgram;
friend class Map;
- MO_DESCR(Immovable_Descr)
+ MO_DESCR(ImmovableDescr)
public:
- Immovable(const Immovable_Descr &);
+ Immovable(const ImmovableDescr &);
~Immovable();
Player * get_owner() const {return m_owner;}
@@ -267,9 +267,9 @@
// TODO(unknown): Remove as soon as we fully support the new system
bool has_new_save_support() override {return true;}
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &,
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &,
const OneWorldLegacyLookupTable& lookup_table);
private:
@@ -289,7 +289,7 @@
* also adjusted automatically.
*/
struct PlayerImmovable : public BaseImmovable {
- PlayerImmovable(const Map_Object_Descr &);
+ PlayerImmovable(const MapObjectDescr &);
virtual ~PlayerImmovable();
Player * get_owner() const {return m_owner;}
@@ -351,7 +351,7 @@
};
public:
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
};
}
=== modified file 'src/logic/immovable_program.h'
--- src/logic/immovable_program.h 2014-07-26 10:43:23 +0000
+++ src/logic/immovable_program.h 2014-07-28 18:15:26 +0000
@@ -65,7 +65,7 @@
/// will not be stopped by this command. It will run until another animation
/// is started.)
struct ActAnimate : public Action {
- ActAnimate(char * parameters, Immovable_Descr &);
+ ActAnimate(char * parameters, ImmovableDescr &);
void execute(Game &, Immovable &) const override;
uint32_t animation() const {return m_id;}
private:
@@ -91,7 +91,7 @@
/// name of the replacement object
struct ActTransform : public Action {
ActTransform
- (char * parameters, Immovable_Descr &);
+ (char * parameters, ImmovableDescr &);
void execute(Game &, Immovable &) const override;
private:
std::string type_name;
@@ -103,7 +103,7 @@
/// Like ActTransform but the probability is determined by the suitability.
struct ActGrow : public Action {
ActGrow
- (char * parameters, Immovable_Descr &);
+ (char * parameters, ImmovableDescr &);
void execute(Game &, Immovable &) const override;
private:
std::string type_name;
@@ -111,14 +111,14 @@
};
struct ActRemove : public Action {
- ActRemove(char * parameters, Immovable_Descr &);
+ ActRemove(char * parameters, ImmovableDescr &);
void execute(Game &, Immovable &) const override;
private:
uint8_t probability;
};
struct ActSeed : public Action {
- ActSeed(char * parameters, Immovable_Descr &);
+ ActSeed(char * parameters, ImmovableDescr &);
void execute(Game &, Immovable &) const override;
private:
std::string type_name;
@@ -142,7 +142,7 @@
/// Plays the specified soundFX with the specified priority. Whether the
/// soundFX is actually played is determined by the sound handler.
struct ActPlayFX : public Action {
- ActPlayFX(const std::string & directory, char * parameters, const Immovable_Descr &);
+ ActPlayFX(const std::string & directory, char * parameters, const ImmovableDescr &);
void execute(Game &, Immovable &) const override;
private:
std::string name;
@@ -163,7 +163,7 @@
* Time until construction decays one step if no progress has been made.
*/
struct ActConstruction : public Action {
- ActConstruction(char * parameters, Immovable_Descr &, const std::string & directory, Profile &);
+ ActConstruction(char * parameters, ImmovableDescr &, const std::string & directory, Profile &);
void execute(Game &, Immovable &) const override;
Duration buildtime() const {return m_buildtime;}
@@ -185,14 +185,14 @@
// Create an immovable program from a number of lines.
ImmovableProgram(const std::string& init_name,
const std::vector<std::string>& lines,
- Immovable_Descr* immovable);
+ ImmovableDescr* immovable);
/// Create a program by parsing a conf-file section.
ImmovableProgram
(const std::string & directory,
Profile &,
const std::string & name,
- Immovable_Descr &);
+ ImmovableDescr &);
~ImmovableProgram() {
for (Action * action : m_actions) {
=== modified file 'src/logic/instances.cc'
--- src/logic/instances.cc 2014-07-26 09:48:21 +0000
+++ src/logic/instances.cc 2014-07-28 18:15:26 +0000
@@ -37,22 +37,22 @@
namespace Widelands {
-Cmd_Destroy_Map_Object::Cmd_Destroy_Map_Object
- (int32_t const t, Map_Object & o)
+CmdDestroyMapObject::CmdDestroyMapObject
+ (int32_t const t, MapObject & o)
: GameLogicCommand(t), obj_serial(o.serial())
{}
-void Cmd_Destroy_Map_Object::execute(Game & game)
+void CmdDestroyMapObject::execute(Game & game)
{
game.syncstream().Unsigned32(obj_serial);
- if (Map_Object * obj = game.objects().get_object(obj_serial))
+ if (MapObject * obj = game.objects().get_object(obj_serial))
obj->destroy (game);
}
#define CMD_DESTROY_MAP_OBJECT_VERSION 1
-void Cmd_Destroy_Map_Object::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+void CmdDestroyMapObject::Read
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -60,7 +60,7 @@
GameLogicCommand::Read(fr, egbase, mol);
if (Serial const serial = fr.Unsigned32())
try {
- obj_serial = mol.get<Map_Object>(serial).serial();
+ obj_serial = mol.get<MapObject>(serial).serial();
} catch (const _wexception & e) {
throw game_data_error("%u: %s", serial, e.what());
}
@@ -73,8 +73,8 @@
throw game_data_error("destroy map object: %s", e.what());
}
}
-void Cmd_Destroy_Map_Object::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+void CmdDestroyMapObject::Write
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(CMD_DESTROY_MAP_OBJECT_VERSION);
@@ -86,7 +86,7 @@
fw.Unsigned32(mos.get_object_file_index_or_zero(egbase.objects().get_object(obj_serial)));
}
-Cmd_Act::Cmd_Act(int32_t const t, Map_Object & o, int32_t const a) :
+Cmd_Act::Cmd_Act(int32_t const t, MapObject & o, int32_t const a) :
GameLogicCommand(t), obj_serial(o.serial()), arg(a)
{}
@@ -95,14 +95,14 @@
{
game.syncstream().Unsigned32(obj_serial);
- if (Map_Object * const obj = game.objects().get_object(obj_serial))
+ if (MapObject * const obj = game.objects().get_object(obj_serial))
obj->act(game, arg);
// the object must queue the next CMD_ACT itself if necessary
}
#define CMD_ACT_VERSION 1
void Cmd_Act::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -110,7 +110,7 @@
GameLogicCommand::Read(fr, egbase, mol);
if (Serial const object_serial = fr.Unsigned32())
try {
- obj_serial = mol.get<Map_Object>(object_serial).serial();
+ obj_serial = mol.get<MapObject>(object_serial).serial();
} catch (const _wexception & e) {
throw game_data_error
("object %u: %s", object_serial, e.what());
@@ -126,7 +126,7 @@
}
}
void Cmd_Act::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(CMD_ACT_VERSION);
@@ -164,9 +164,9 @@
}
/**
- * Insert the given Map_Object into the object manager
+ * Insert the given MapObject into the object manager
*/
-void Object_Manager::insert(Map_Object * obj)
+void Object_Manager::insert(MapObject * obj)
{
++m_lastserial;
assert(m_lastserial);
@@ -175,9 +175,9 @@
}
/**
- * Remove the Map_Object from the manager
+ * Remove the MapObject from the manager
*/
-void Object_Manager::remove(Map_Object & obj)
+void Object_Manager::remove(MapObject & obj)
{
m_objects.erase(obj.m_serial);
}
@@ -188,7 +188,7 @@
std::vector<Serial> Object_Manager::all_object_serials_ordered () const {
std::vector<Serial> rv;
- for (const std::pair<Serial, Map_Object *>& o : m_objects) {
+ for (const std::pair<Serial, MapObject *>& o : m_objects) {
rv.push_back(o.first);
}
@@ -197,11 +197,11 @@
return rv;
}
-Map_Object * Object_Ptr::get(const Editor_Game_Base & egbase)
+MapObject * Object_Ptr::get(const Editor_Game_Base & egbase)
{
if (!m_serial)
return nullptr;
- Map_Object * const obj = egbase.objects().get_object(m_serial);
+ MapObject * const obj = egbase.objects().get_object(m_serial);
if (!obj)
m_serial = 0;
return obj;
@@ -211,7 +211,7 @@
// because it is logically the pointer that is const, not the object
// that is pointed to.
// That is, a 'const Object_Ptr' behaves like a 'Object_Ptr * const'.
-Map_Object * Object_Ptr::get(const Editor_Game_Base & egbase) const {
+MapObject * Object_Ptr::get(const Editor_Game_Base & egbase) const {
return m_serial ? egbase.objects().get_object(m_serial) : nullptr;
}
@@ -221,19 +221,19 @@
/*
==============================================================================
-Map_Object_Descr IMPLEMENTATION
+MapObjectDescr IMPLEMENTATION
==============================================================================
*/
-uint32_t Map_Object_Descr::s_dyn_attribhigh =
- Map_Object::HIGHEST_FIXED_ATTRIBUTE;
-Map_Object_Descr::AttribMap Map_Object_Descr::s_dyn_attribs;
+uint32_t MapObjectDescr::s_dyn_attribhigh =
+ MapObject::HIGHEST_FIXED_ATTRIBUTE;
+MapObjectDescr::AttribMap MapObjectDescr::s_dyn_attribs;
/**
* Add this animation for this map object under this name
*/
-bool Map_Object_Descr::is_animation_known(const std::string & animname) const {
+bool MapObjectDescr::is_animation_known(const std::string & animname) const {
for (const std::pair<std::string, uint32_t>& anim : m_anims) {
if (anim.first == animname) {
return true;
@@ -242,7 +242,7 @@
return false;
}
-void Map_Object_Descr::add_animation
+void MapObjectDescr::add_animation
(const std::string & animname, uint32_t const anim)
{
#ifndef NDEBUG
@@ -256,7 +256,7 @@
m_anims.insert(std::pair<std::string, uint32_t>(animname, anim));
}
-std::string Map_Object_Descr::get_animation_name(uint32_t const anim) const {
+std::string MapObjectDescr::get_animation_name(uint32_t const anim) const {
for (const std::pair<std::string, uint32_t>& temp_anim : m_anims) {
if (temp_anim.second == anim) {
@@ -273,7 +273,7 @@
/**
* Search for the attribute in the attribute list
*/
-bool Map_Object_Descr::has_attribute(uint32_t const attr) const {
+bool MapObjectDescr::has_attribute(uint32_t const attr) const {
for (const uint32_t& attrib : m_attributes) {
if (attrib == attr) {
return true;
@@ -286,17 +286,17 @@
/**
* Add an attribute to the attribute list if it's not already there
*/
-void Map_Object_Descr::add_attribute(uint32_t const attr)
+void MapObjectDescr::add_attribute(uint32_t const attr)
{
if (!has_attribute(attr))
m_attributes.push_back(attr);
}
-void Map_Object_Descr::add_attributes(const std::vector<std::string>& attributes,
+void MapObjectDescr::add_attributes(const std::vector<std::string>& attributes,
const std::set<uint32_t>& allowed_special) {
for (const std::string& attribute : attributes) {
uint32_t const attrib = get_attribute_id(attribute);
- if (attrib < Map_Object::HIGHEST_FIXED_ATTRIBUTE) {
+ if (attrib < MapObject::HIGHEST_FIXED_ATTRIBUTE) {
if (!allowed_special.count(attrib)) {
throw game_data_error("bad attribute \"%s\"", attribute.c_str());
}
@@ -309,16 +309,16 @@
* Lookup an attribute by name. If the attribute name hasn't been encountered
* before, we add it to the map.
*/
-uint32_t Map_Object_Descr::get_attribute_id(const std::string & name) {
+uint32_t MapObjectDescr::get_attribute_id(const std::string & name) {
AttribMap::iterator it = s_dyn_attribs.find(name);
if (it != s_dyn_attribs.end())
return it->second;
if (name == "worker")
- return Map_Object::WORKER;
+ return MapObject::WORKER;
else if (name == "resi")
- return Map_Object::RESI;
+ return MapObject::RESI;
++s_dyn_attribhigh;
s_dyn_attribs[name] = s_dyn_attribhigh;
@@ -332,7 +332,7 @@
* Lookup an attribute by id. If the attribute isn't found,
* returns an emtpy string.
*/
-std::string Map_Object_Descr::get_attribute_name(uint32_t id) {
+std::string MapObjectDescr::get_attribute_name(uint32_t id) {
for
(AttribMap::iterator iter = s_dyn_attribs.begin();
iter != s_dyn_attribs.end(); ++iter)
@@ -346,7 +346,7 @@
/*
==============================================================================
-Map_Object IMPLEMENTATION
+MapObject IMPLEMENTATION
==============================================================================
*/
@@ -354,7 +354,7 @@
/**
* Zero-initialize a map object
*/
-Map_Object::Map_Object(const Map_Object_Descr * const the_descr) :
+MapObject::MapObject(const MapObjectDescr * const the_descr) :
m_descr(the_descr), m_serial(0), m_logsink(nullptr)
{}
@@ -363,7 +363,7 @@
* Call this function if you want to remove the object immediately, without
* any effects.
*/
-void Map_Object::remove(Editor_Game_Base & egbase)
+void MapObject::remove(Editor_Game_Base & egbase)
{
removed(m_serial); // Signal call
cleanup(egbase);
@@ -381,7 +381,7 @@
* the object. Therefore, it may be safer to call schedule_destroy()
* instead.
*/
-void Map_Object::destroy(Editor_Game_Base & egbase)
+void MapObject::destroy(Editor_Game_Base & egbase)
{
remove(egbase);
}
@@ -390,10 +390,10 @@
* Schedule the object for immediate destruction.
* This can be used to safely destroy the object from within an act function.
*/
-void Map_Object::schedule_destroy(Game & game)
+void MapObject::schedule_destroy(Game & game)
{
game.cmdqueue().enqueue
- (new Cmd_Destroy_Map_Object(game.get_gametime(), *this));
+ (new CmdDestroyMapObject(game.get_gametime(), *this));
}
/**
@@ -401,7 +401,7 @@
*
* \warning Make sure you call this from derived classes!
*/
-void Map_Object::init(Editor_Game_Base & egbase)
+void MapObject::init(Editor_Game_Base & egbase)
{
egbase.objects().insert(this);
}
@@ -409,7 +409,7 @@
/**
* \warning Make sure you call this from derived classes!
*/
-void Map_Object::cleanup(Editor_Game_Base & egbase)
+void MapObject::cleanup(Editor_Game_Base & egbase)
{
egbase.objects().remove(*this);
}
@@ -417,7 +417,7 @@
/**
* Default implementation
*/
-int32_t Map_Object::get_tattribute(uint32_t) const
+int32_t MapObject::get_tattribute(uint32_t) const
{
return -1;
}
@@ -428,7 +428,7 @@
*
* \return The absolute gametime at which the CMD_ACT will occur.
*/
-uint32_t Map_Object::schedule_act
+uint32_t MapObject::schedule_act
(Game & game, uint32_t const tdelta, uint32_t const data)
{
if (tdelta < Forever()) {
@@ -445,24 +445,24 @@
/**
* Called when a CMD_ACT triggers.
*/
-void Map_Object::act(Game &, uint32_t) {}
+void MapObject::act(Game &, uint32_t) {}
/**
* Set the logsink. This should only be used by the debugging facilities.
*/
-void Map_Object::set_logsink(LogSink * const sink)
+void MapObject::set_logsink(LogSink * const sink)
{
m_logsink = sink;
}
-void Map_Object::log_general_info(const Editor_Game_Base &) {}
+void MapObject::log_general_info(const Editor_Game_Base &) {}
/**
* Prints a log message prepended by the object's serial number.
*/
-void Map_Object::molog(char const * fmt, ...) const
+void MapObject::molog(char const * fmt, ...) const
{
if (!g_verbose && !m_logsink)
return;
@@ -485,20 +485,20 @@
/**
* Load the entire data package from the given file.
- * This will be called from the Map_Object's derived class static load function.
+ * This will be called from the MapObject's derived class static load function.
*
* Derived functions must read all data into member variables, even if
* it is used only later in \ref load_pointers or \ref load_finish .
*
* Derived functions must call ancestor's function in the appropriate place.
*/
-void Map_Object::Loader::load(FileRead & fr)
+void MapObject::Loader::load(FileRead & fr)
{
try {
uint8_t const header = fr.Unsigned8();
- if (header != header_Map_Object)
+ if (header != HeaderMapObject)
throw wexception
- ("header is %u, expected %u", header, header_Map_Object);
+ ("header is %u, expected %u", header, HeaderMapObject);
uint8_t const version = fr.Unsigned8();
if (version != CURRENT_SAVEGAME_VERSION)
@@ -506,7 +506,7 @@
Serial const serial = fr.Unsigned32();
try {
- mol().register_object<Map_Object>(serial, *get_object());
+ mol().register_object<MapObject>(serial, *get_object());
} catch (const _wexception & e) {
throw wexception("%u: %s", serial, e.what());
}
@@ -526,7 +526,7 @@
*
* Derived functions must call ancestor's function in the appropriate place.
*/
-void Map_Object::Loader::load_pointers() {}
+void MapObject::Loader::load_pointers() {}
/**
@@ -537,66 +537,66 @@
*
* Derived functions must call ancestor's function in the appropriate place.
*/
-void Map_Object::Loader::load_finish()
+void MapObject::Loader::load_finish()
{
}
/**
- * Save the Map_Object to the given file.
+ * Save the MapObject to the given file.
*/
-void Map_Object::save
- (Editor_Game_Base &, Map_Map_Object_Saver & mos, FileWrite & fw)
+void MapObject::save
+ (Editor_Game_Base &, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Map_Object);
+ fw.Unsigned8(HeaderMapObject);
fw.Unsigned8(CURRENT_SAVEGAME_VERSION);
fw.Unsigned32(mos.get_object_file_index(*this));
}
-std::string to_string(const Map_Object_Type type) {
+std::string to_string(const MapObjectType type) {
switch (type) {
- case Map_Object_Type::BOB:
+ case MapObjectType::BOB:
return "bob";
- case Map_Object_Type::CRITTER:
+ case MapObjectType::CRITTER:
return "critter";
- case Map_Object_Type::SHIP:
+ case MapObjectType::SHIP:
return "ship";
- case Map_Object_Type::WORKER:
+ case MapObjectType::WORKER:
return "worker";
- case Map_Object_Type::CARRIER:
+ case MapObjectType::CARRIER:
return "carrier";
- case Map_Object_Type::SOLDIER:
+ case MapObjectType::SOLDIER:
return "soldier";
- case Map_Object_Type::WARE:
+ case MapObjectType::WARE:
return "ware";
- case Map_Object_Type::BATTLE:
+ case MapObjectType::BATTLE:
return "battle";
- case Map_Object_Type::FLEET:
+ case MapObjectType::FLEET:
return "fleet";
- case Map_Object_Type::IMMOVABLE:
+ case MapObjectType::IMMOVABLE:
return "immovable";
- case Map_Object_Type::FLAG:
+ case MapObjectType::FLAG:
return "flag";
- case Map_Object_Type::ROAD:
+ case MapObjectType::ROAD:
return "road";
- case Map_Object_Type::PORTDOCK:
+ case MapObjectType::PORTDOCK:
return "portdock";
- case Map_Object_Type::BUILDING:
+ case MapObjectType::BUILDING:
return "building";
- case Map_Object_Type::CONSTRUCTIONSITE:
+ case MapObjectType::CONSTRUCTIONSITE:
return "constructionsite";
- case Map_Object_Type::DISMANTLESITE:
+ case MapObjectType::DISMANTLESITE:
return "dismantlesite";
- case Map_Object_Type::WAREHOUSE:
+ case MapObjectType::WAREHOUSE:
return "warehouse";
- case Map_Object_Type::PRODUCTIONSITE:
+ case MapObjectType::PRODUCTIONSITE:
return "productionsite";
- case Map_Object_Type::MILITARYSITE:
+ case MapObjectType::MILITARYSITE:
return "militarysite";
- case Map_Object_Type::TRAININGSITE:
+ case MapObjectType::TRAININGSITE:
return "trainingsite";
default:
- throw wexception("Unknown Map_Object_Type %d.", static_cast<int>(type));
+ throw wexception("Unknown MapObjectType %d.", static_cast<int>(type));
}
}
=== modified file 'src/logic/instances.h'
--- src/logic/instances.h 2014-07-26 10:43:23 +0000
+++ src/logic/instances.h 2014-07-28 18:15:26 +0000
@@ -44,12 +44,12 @@
namespace Widelands {
class EditorCategory;
-class Map_Map_Object_Loader;
+class MapMapObjectLoader;
class Player;
struct Path;
// This enum lists the available classes of Map Objects.
-enum class Map_Object_Type : uint8_t {
+enum class MapObjectType : uint8_t {
MAPOBJECT = 0, // Root superclass
WARE, // class WareInstance
@@ -57,7 +57,7 @@
FLEET,
BOB = 10, // Bob
- CRITTER, // Bob -- CritterBob
+ CRITTER, // Bob -- Critter
SHIP, // Bob -- Ship
WORKER, // Bob -- Worker
CARRIER, // Bob -- Worker -- Carrier
@@ -82,26 +82,26 @@
};
// Returns a string representation for 'type'.
-std::string to_string(Map_Object_Type type);
+std::string to_string(MapObjectType type);
/**
* Base class for descriptions of worker, files and so on. This must just
* link them together
*/
-struct Map_Object_Descr {
+struct MapObjectDescr {
- Map_Object_Descr(const Map_Object_Type type,
+ MapObjectDescr(const MapObjectType init_type,
const std::string& init_name,
const std::string& init_descname)
- : m_type(type), m_name(init_name), m_descname(init_descname) {
+ : m_type(init_type), m_name(init_name), m_descname(init_descname) {
}
- virtual ~Map_Object_Descr() {m_anims.clear();}
+ virtual ~MapObjectDescr() {m_anims.clear();}
const std::string & name() const {return m_name;}
const std::string & descname() const {return m_descname;}
- // Type of the Map_Object_Descr.
- Map_Object_Type type() const {return m_type;}
+ // Type of the MapObjectDescr.
+ MapObjectType type() const {return m_type;}
struct Animation_Nonexistent {};
uint32_t get_animation(char const * const anim) const {
@@ -137,7 +137,7 @@
typedef std::map<std::string, uint32_t> AttribMap;
typedef std::vector<uint32_t> Attributes;
- const Map_Object_Type m_type; /// Subclasses pick from the enum above
+ const MapObjectType m_type; /// Subclasses pick from the enum above
std::string const m_name; /// The name for internal reference
std::string const m_descname; /// A localized Descriptive name
Attributes m_attributes;
@@ -145,18 +145,18 @@
static uint32_t s_dyn_attribhigh; ///< highest attribute ID used
static AttribMap s_dyn_attribs;
- DISALLOW_COPY_AND_ASSIGN(Map_Object_Descr);
+ DISALLOW_COPY_AND_ASSIGN(MapObjectDescr);
};
/**
- * \par Notes on Map_Object
+ * \par Notes on MapObject
*
- * Map_Object is the base class for everything that can be on the map:
+ * MapObject is the base class for everything that can be on the map:
* buildings, animals, decorations, etc... most of the time, however, you'll
* deal with one of the derived classes, BaseImmovable or Bob.
*
- * Every Map_Object has a unique serial number. This serial number is used as
+ * Every MapObject has a unique serial number. This serial number is used as
* key in the Object_Manager map, and in the safe Object_Ptr.
*
* Unless you're perfectly sure about when an object can be destroyed you
@@ -164,10 +164,10 @@
* This is not necessary when the relationship and lifetime between objects
* is well-defined, such as in the relationship between Building and Flag.
*
- * Map_Objects can also have attributes. They are mainly useful for finding
+ * MapObjects can also have attributes. They are mainly useful for finding
* objects of a given type (e.g. trees) within a certain radius.
*
- * \warning DO NOT allocate/free Map_Objects directly. Use the appropriate
+ * \warning DO NOT allocate/free MapObjects directly. Use the appropriate
* type-dependent create() function for creation, and call die() for removal.
*
* \note Convenient creation functions are defined in class Game.
@@ -183,14 +183,14 @@
/// or additional member variable, go ahead
#define MO_DESCR(type) \
public: const type & descr() const { \
- return ref_cast<type const, Map_Object_Descr const>(*m_descr); \
+ return ref_cast<type const, MapObjectDescr const>(*m_descr); \
} \
-class Map_Object {
+class MapObject {
friend struct Object_Manager;
friend struct Object_Ptr;
- MO_DESCR(Map_Object_Descr)
+ MO_DESCR(MapObjectDescr)
public:
/// Some default, globally valid, attributes.
@@ -213,8 +213,8 @@
virtual void load_finish(Editor_Game_Base &) {}
protected:
- Map_Object(Map_Object_Descr const * descr);
- virtual ~Map_Object() {}
+ MapObject(MapObjectDescr const * descr);
+ virtual ~MapObject() {}
public:
Serial serial() const {return m_serial;}
@@ -263,20 +263,20 @@
virtual void log_general_info(const Editor_Game_Base &);
// Header bytes to distinguish between data packages for the different
- // Map_Object classes. Be careful in changing those, since they are written
+ // MapObject classes. Be careful in changing those, since they are written
// to files.
enum {
- header_Map_Object = 1,
- header_Immovable = 2,
+ HeaderMapObject = 1,
+ HeaderImmovable = 2,
// 3 was battle object.
// 4 was attack controller.
- header_Battle = 5,
- header_Critter = 6,
- header_Worker = 7,
- header_WareInstance = 8,
- header_Ship = 9,
- header_PortDock = 10,
- header_Fleet = 11,
+ HeaderBattle = 5,
+ HeaderCritter = 6,
+ HeaderWorker = 7,
+ HeaderWareInstance = 8,
+ HeaderShip = 9,
+ HeaderPortDock = 10,
+ HeaderFleet = 11,
};
/**
@@ -290,8 +290,8 @@
*/
struct Loader {
Editor_Game_Base * m_egbase;
- Map_Map_Object_Loader * m_mol;
- Map_Object * m_object;
+ MapMapObjectLoader * m_mol;
+ MapObject * m_object;
protected:
Loader() : m_egbase(nullptr), m_mol(nullptr), m_object(nullptr) {}
@@ -300,7 +300,7 @@
virtual ~Loader() {}
void init
- (Editor_Game_Base & e, Map_Map_Object_Loader & m, Map_Object & object)
+ (Editor_Game_Base & e, MapMapObjectLoader & m, MapObject & object)
{
m_egbase = &e;
m_mol = &m;
@@ -308,10 +308,10 @@
}
Editor_Game_Base & egbase () {return *m_egbase;}
- Map_Map_Object_Loader & mol () {return *m_mol;}
- Map_Object * get_object() {return m_object;}
+ MapMapObjectLoader & mol () {return *m_mol;}
+ MapObject * get_object() {return m_object;}
template<typename T> T & get() {
- return ref_cast<T, Map_Object>(*m_object);
+ return ref_cast<T, MapObject>(*m_object);
}
protected:
@@ -323,11 +323,11 @@
};
/// This is just a fail-safe guard for the time until we fully transition
- /// to the new Map_Object saving system
+ /// to the new MapObject saving system
virtual bool has_new_save_support() {return false;}
- virtual void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &);
- // Pure Map_Objects cannot be loaded
+ virtual void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &);
+ // Pure MapObjects cannot be loaded
protected:
/// Called only when the oject is logically created in the simulation. If
@@ -340,12 +340,12 @@
void molog(char const * fmt, ...) const
__attribute__((format(printf, 2, 3)));
- const Map_Object_Descr * m_descr;
+ const MapObjectDescr * m_descr;
Serial m_serial;
LogSink * m_logsink;
private:
- DISALLOW_COPY_AND_ASSIGN(Map_Object);
+ DISALLOW_COPY_AND_ASSIGN(MapObject);
};
inline int32_t get_reverse_dir(int32_t const dir) {
@@ -358,22 +358,22 @@
* Keeps the list of all objects currently in the game.
*/
struct Object_Manager {
- typedef boost::unordered_map<Serial, Map_Object *> objmap_t;
+ typedef boost::unordered_map<Serial, MapObject *> objmap_t;
Object_Manager() {m_lastserial = 0;}
~Object_Manager();
void cleanup(Editor_Game_Base &);
- Map_Object * get_object(Serial const serial) const {
+ MapObject * get_object(Serial const serial) const {
const objmap_t::const_iterator it = m_objects.find(serial);
return it != m_objects.end() ? it->second : nullptr;
}
- void insert(Map_Object *);
- void remove(Map_Object &);
+ void insert(MapObject *);
+ void remove(MapObject &);
- bool object_still_available(const Map_Object * const t) const {
+ bool object_still_available(const MapObject * const t) const {
if (!t)
return false;
objmap_t::const_iterator it = m_objects.begin();
@@ -399,15 +399,15 @@
};
/**
- * Provides a safe pointer to a Map_Object
+ * Provides a safe pointer to a MapObject
*/
struct Object_Ptr {
// Provide default constructor to shut up cppcheck.
Object_Ptr() {m_serial = 0;}
- Object_Ptr(Map_Object * const obj) {m_serial = obj ? obj->m_serial : 0;}
+ Object_Ptr(MapObject * const obj) {m_serial = obj ? obj->m_serial : 0;}
// can use standard copy constructor and assignment operator
- Object_Ptr & operator= (Map_Object * const obj) {
+ Object_Ptr & operator= (MapObject * const obj) {
m_serial = obj ? obj->m_serial : 0;
return *this;
}
@@ -415,9 +415,9 @@
bool is_set() const {return m_serial;}
// dammit... without a Editor_Game_Base object, we can't implement a
- // Map_Object* operator (would be _really_ nice)
- Map_Object * get(const Editor_Game_Base &);
- Map_Object * get(const Editor_Game_Base & egbase) const;
+ // MapObject* operator (would be _really_ nice)
+ MapObject * get(const Editor_Game_Base &);
+ MapObject * get(const Editor_Game_Base & egbase) const;
bool operator< (const Object_Ptr & other) const {
return m_serial < other.m_serial;
@@ -463,13 +463,13 @@
Object_Ptr m;
};
-struct Cmd_Destroy_Map_Object : public GameLogicCommand {
- Cmd_Destroy_Map_Object() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading
- Cmd_Destroy_Map_Object (int32_t t, Map_Object &);
+struct CmdDestroyMapObject : public GameLogicCommand {
+ CmdDestroyMapObject() : GameLogicCommand(0), obj_serial(0) {} ///< For savegame loading
+ CmdDestroyMapObject (int32_t t, MapObject &);
void execute (Game &) override;
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_DESTROY_MAPOBJECT;}
@@ -479,12 +479,12 @@
struct Cmd_Act : public GameLogicCommand {
Cmd_Act() : GameLogicCommand(0), obj_serial(0), arg(0) {} ///< For savegame loading
- Cmd_Act (int32_t t, Map_Object &, int32_t a);
+ Cmd_Act (int32_t t, MapObject &, int32_t a);
void execute (Game &) override;
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_ACT;}
=== modified file 'src/logic/map.cc'
--- src/logic/map.cc 2014-07-26 16:37:37 +0000
+++ src/logic/map.cc 2014-07-28 18:15:26 +0000
@@ -101,7 +101,7 @@
===============
Call this function whenever the field at fx/fy has changed in one of the ways:
- height has changed
- - robust Map_Object has been added or removed
+ - robust MapObject has been added or removed
This performs the steps outlined in the comment above Map::recalc_brightness()
and recalcs the interactive player's overlay.
@@ -941,8 +941,8 @@
These events include:
- change of height (e.g. by planing)
- change of terrain (in the editor)
-- insertion of a "robust" Map_Object
-- removal of a "robust" Map_Object
+- insertion of a "robust" MapObject
+- removal of a "robust" MapObject
All these events can change the passability, buildability, etc. of fields
with a radius of two fields. This means that you must build a list of the
@@ -1082,7 +1082,7 @@
// if we are interested in the maximum theoretically available NodeCaps, this is not run
if (consider_mobs) {
- // 3) General buildability check: if a "robust" Map_Object is on this node
+ // 3) General buildability check: if a "robust" MapObject is on this node
// we cannot build anything on it. Exception: we can build flags on roads.
if (BaseImmovable * const imm = get_immovable(f))
if
@@ -1090,7 +1090,7 @@
&&
imm->get_size() >= BaseImmovable::SMALL)
{
- // 3b) [OVERRIDE] check for "unpassable" Map_Objects
+ // 3b) [OVERRIDE] check for "unpassable" MapObjects
if (!imm->get_passable())
caps &= ~(MOVECAPS_WALK | MOVECAPS_SWIM);
return static_cast<NodeCaps>(caps);
@@ -1106,7 +1106,7 @@
find_immovables(
Area<FCoords>(f, 1),
nullptr,
- FindImmovableType(Map_Object_Type::FLAG)))
+ FindImmovableType(MapObjectType::FLAG)))
return static_cast<NodeCaps>(caps);
caps |= BUILDCAPS_FLAG;
}
@@ -1140,7 +1140,7 @@
if
(!(br.field->caps & BUILDCAPS_FLAG)
&&
- (!br.field->get_immovable() || br.field->get_immovable()->descr().type() != Map_Object_Type::FLAG))
+ (!br.field->get_immovable() || br.field->get_immovable()->descr().type() != MapObjectType::FLAG))
return static_cast<NodeCaps>(caps);
} else {
if (!(_calc_nodecaps_pass1(world, br, false) & BUILDCAPS_FLAG))
@@ -1292,7 +1292,7 @@
int objsize = obj->get_size();
if (objsize == BaseImmovable::NONE)
continue;
- if (avoidnature && obj->descr().type() == Map_Object_Type::IMMOVABLE)
+ if (avoidnature && obj->descr().type() == MapObjectType::IMMOVABLE)
objsize += 1;
if (objsize + buildsize > BaseImmovable::BIG)
buildsize = BaseImmovable::BIG - objsize + 1;
@@ -1652,9 +1652,9 @@
}
/**
- * Finds a path from start to end for a Map_Object with the given movecaps.
+ * Finds a path from start to end for a MapObject with the given movecaps.
*
- * The path is stored in \p path, as a series of Map_Object::WalkingDir entries.
+ * The path is stored in \p path, as a series of MapObject::WalkingDir entries.
*
* \param persist tells the function how hard it should try to find a path:
* If \p persist is \c 0, the function will never give up early. Otherwise, the
=== modified file 'src/logic/message.h'
--- src/logic/message.h 2014-07-05 16:41:51 +0000
+++ src/logic/message.h 2014-07-28 18:15:26 +0000
@@ -39,7 +39,7 @@
* \param b The message body
* \param c The message coords. The player will be able to taken there.
* Defaults to Coords::Null()
- * \param ser A Map_Object serial. If non null, the message will expire once
+ * \param ser A MapObject serial. If non null, the message will expire once
* the object is removed from the game. Defaults to 0
* \param s The message status. Defaults to Status::New
*/
=== modified file 'src/logic/message_queue.h'
--- src/logic/message_queue.h 2014-07-14 19:24:12 +0000
+++ src/logic/message_queue.h 2014-07-28 18:15:26 +0000
@@ -126,7 +126,7 @@
iterator const it = find(id);
if (it == end()) {
// Messages can be expired when the timeout runs out, or when the linked
- // Map_Object is removed, or both. In this later case, two expire commands
+ // MapObject is removed, or both. In this later case, two expire commands
// will be executed, and the message will not be present for the second one.
// So we assume here that the message was removed from an earlier expire cmd.
return;
=== modified file 'src/logic/militarysite.cc'
--- src/logic/militarysite.cc 2014-07-26 09:48:21 +0000
+++ src/logic/militarysite.cc 2014-07-28 18:15:26 +0000
@@ -40,15 +40,15 @@
namespace Widelands {
-MilitarySite_Descr::MilitarySite_Descr
+MilitarySiteDescr::MilitarySiteDescr
(char const * const _name,
char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe,
const World& world)
:
- ProductionSite_Descr
- (Map_Object_Type::MILITARYSITE, _name, _descname, directory, prof, global_s, _tribe, world),
+ ProductionSiteDescr
+ (MapObjectType::MILITARYSITE, _name, _descname, directory, prof, global_s, _tribe, world),
m_conquer_radius (0),
m_num_soldiers (0),
m_heal_per_second (0)
@@ -72,7 +72,7 @@
Create a new building of this type
===============
*/
-Building & MilitarySite_Descr::create_object() const {
+Building & MilitarySiteDescr::create_object() const {
return *new MilitarySite(*this);
}
@@ -85,7 +85,7 @@
=============================
*/
-MilitarySite::MilitarySite(const MilitarySite_Descr & ms_descr) :
+MilitarySite::MilitarySite(const MilitarySiteDescr & ms_descr) :
ProductionSite(ms_descr),
m_didconquer (false),
m_capacity (ms_descr.get_max_number_of_soldiers()),
@@ -624,7 +624,7 @@
bool stayhome;
if
- (Map_Object * const enemy
+ (MapObject * const enemy
=
popSoldierJob(soldier, &stayhome))
{
@@ -866,7 +866,7 @@
// the new owner comes from another tribe
Building::FormerBuildings former_buildings;
for (Building_Index former_idx : m_old_buildings) {
- const Building_Descr * old_descr = descr().tribe().get_building_descr(former_idx);
+ const BuildingDescr * old_descr = descr().tribe().get_building_descr(former_idx);
std::string bldname = old_descr->name();
// Has this building already a suffix? == conquered building?
std::string::size_type const dot = bldname.rfind('.');
@@ -1004,14 +1004,14 @@
* \return the enemy, if any, that the given soldier was scheduled
* to attack, and remove the job.
*/
-Map_Object * MilitarySite::popSoldierJob
+MapObject * MilitarySite::popSoldierJob
(Soldier * const soldier, bool * const stayhome)
{
for (std::vector<SoldierJob>::iterator job_iter = m_soldierjobs.begin();
job_iter != m_soldierjobs.end(); ++job_iter)
{
if (job_iter->soldier == soldier) {
- Map_Object * const enemy = job_iter->enemy.get(owner().egbase());
+ MapObject * const enemy = job_iter->enemy.get(owner().egbase());
if (stayhome)
*stayhome = job_iter->stayhome;
m_soldierjobs.erase(job_iter);
=== modified file 'src/logic/militarysite.h'
--- src/logic/militarysite.h 2014-07-26 10:43:23 +0000
+++ src/logic/militarysite.h 2014-07-28 18:15:26 +0000
@@ -33,12 +33,12 @@
class Soldier;
class World;
-struct MilitarySite_Descr : public ProductionSite_Descr {
- MilitarySite_Descr
+struct MilitarySiteDescr : public ProductionSiteDescr {
+ MilitarySiteDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr & tribe, const World& world);
- ~MilitarySite_Descr() override {}
+ ~MilitarySiteDescr() override {}
Building & create_object() const override;
@@ -62,14 +62,14 @@
uint32_t m_conquer_radius;
uint32_t m_num_soldiers;
uint32_t m_heal_per_second;
- DISALLOW_COPY_AND_ASSIGN(MilitarySite_Descr);
+ DISALLOW_COPY_AND_ASSIGN(MilitarySiteDescr);
};
class MilitarySite :
public ProductionSite, public SoldierControl, public Attackable
{
friend class Map_Buildingdata_Data_Packet;
- MO_DESCR(MilitarySite_Descr)
+ MO_DESCR(MilitarySiteDescr)
public:
// I assume elsewhere, that enum SoldierPreference fits to uint8_t.
@@ -79,7 +79,7 @@
kPrefersHeroes,
};
- MilitarySite(const MilitarySite_Descr &);
+ MilitarySite(const MilitarySiteDescr &);
virtual ~MilitarySite();
std::string get_statistics_string() override;
@@ -141,7 +141,7 @@
static void request_soldier_callback
(Game &, Request &, Ware_Index, Worker *, PlayerImmovable &);
- Map_Object * popSoldierJob
+ MapObject * popSoldierJob
(Soldier *, bool * stayhome = nullptr);
bool haveSoldierJob(Soldier &);
bool military_presence_kept(Game &);
=== modified file 'src/logic/nodecaps.h'
--- src/logic/nodecaps.h 2014-07-05 16:41:51 +0000
+++ src/logic/nodecaps.h 2014-07-28 18:15:26 +0000
@@ -47,8 +47,8 @@
/** can we build any building on this field?*/
BUILDCAPS_BUILDINGMASK = BUILDCAPS_SIZEMASK|BUILDCAPS_MINE|BUILDCAPS_PORT,
- /// Can Map_Objects walk or swim here? Also used for
- /// Map_Object_Descr::movecaps. If MOVECAPS_WALK, any walking being can walk
+ /// Can MapObjects walk or swim here? Also used for
+ /// MapObjectDescr::movecaps. If MOVECAPS_WALK, any walking being can walk
/// to this field.
MOVECAPS_WALK = 32,
=== modified file 'src/logic/partially_finished_building.cc'
--- src/logic/partially_finished_building.cc 2014-07-25 22:20:55 +0000
+++ src/logic/partially_finished_building.cc 2014-07-28 18:15:26 +0000
@@ -31,7 +31,7 @@
namespace Widelands {
Partially_Finished_Building::Partially_Finished_Building
- (const Building_Descr & gdescr) :
+ (const BuildingDescr & gdescr) :
Building (gdescr),
m_building (nullptr),
m_builder_request(nullptr),
@@ -46,7 +46,7 @@
Set the type of building we're going to build
===============
*/
-void Partially_Finished_Building::set_building(const Building_Descr & building_descr) {
+void Partially_Finished_Building::set_building(const BuildingDescr & building_descr) {
assert(!m_building);
m_building = &building_descr;
=== modified file 'src/logic/partially_finished_building.h'
--- src/logic/partially_finished_building.h 2014-07-26 10:57:26 +0000
+++ src/logic/partially_finished_building.h 2014-07-28 18:15:26 +0000
@@ -39,9 +39,9 @@
friend struct Map_Building_Data_Packet;
public:
- Partially_Finished_Building(const Building_Descr & building_descr);
+ Partially_Finished_Building(const BuildingDescr & building_descr);
- virtual void set_building (const Building_Descr &);
+ virtual void set_building (const BuildingDescr &);
int32_t get_size() const override;
uint32_t get_playercaps() const override;
@@ -64,7 +64,7 @@
virtual uint32_t build_step_time() const = 0;
protected:
- const Building_Descr * m_building; // type of building that was or will become
+ const BuildingDescr * m_building; // type of building that was or will become
Request * m_builder_request;
OPtr<Worker> m_builder;
=== modified file 'src/logic/player.cc'
--- src/logic/player.cc 2014-07-25 22:38:39 +0000
+++ src/logic/player.cc 2014-07-28 18:15:26 +0000
@@ -61,7 +61,7 @@
void terraform_for_building
(Widelands::Editor_Game_Base& egbase, const Widelands::Player_Number player_number,
- const Widelands::Coords location, const Widelands::Building_Descr* descr)
+ const Widelands::Coords location, const Widelands::BuildingDescr* descr)
{
Widelands::Map & map = egbase.map();
Widelands::FCoords c[4]; // Big buildings occupy 4 locations.
@@ -110,7 +110,7 @@
/**
* Find the longest possible enhancement chain leading to the given
* building descr. The FormerBuildings given in reference must be empty and will be
- * filled with the Building_Descr.
+ * filled with the BuildingDescr.
*/
void find_former_buildings
(const Widelands::Tribe_Descr & tribe_descr, const Widelands::Building_Index bi,
@@ -121,7 +121,7 @@
for (;;) {
Widelands::Building_Index oldest_idx = former_buildings->front();
- const Widelands::Building_Descr * oldest = tribe_descr.get_building_descr(oldest_idx);
+ const Widelands::BuildingDescr * oldest = tribe_descr.get_building_descr(oldest_idx);
if (!oldest->is_enhanced()) {
break;
}
@@ -130,7 +130,7 @@
i < tribe_descr.get_nrbuildings();
++i)
{
- const Widelands::Building_Descr* ob = tribe_descr.get_building_descr(i);
+ const Widelands::BuildingDescr* ob = tribe_descr.get_building_descr(i);
if (ob->enhancement() == oldest_idx) {
former_buildings->insert(former_buildings->begin(), i);
break;
@@ -318,9 +318,9 @@
(game.get_gametime() + duration, player_number(), id));
}
- // Map_Object connection
+ // MapObject connection
if (message.serial() > 0) {
- Map_Object* mo = egbase().objects().get_object(message.serial());
+ MapObject* mo = egbase().objects().get_object(message.serial());
mo->removed.connect
(boost::bind(&Player::message_object_removed, this, id));
}
@@ -506,11 +506,11 @@
Building & Player::force_building
(Coords const location,
- const Building_Descr::FormerBuildings & former_buildings)
+ const BuildingDescr::FormerBuildings & former_buildings)
{
Map & map = egbase().map();
Building_Index idx = former_buildings.back();
- const Building_Descr* descr = tribe().get_building_descr(idx);
+ const BuildingDescr* descr = tribe().get_building_descr(idx);
terraform_for_building(egbase(), player_number(), location, descr);
FCoords flag_loc;
map.get_brn(map.get_fcoords(location), &flag_loc);
@@ -523,12 +523,12 @@
Building& Player::force_csite
(Coords const location, Building_Index b_idx,
- const Building_Descr::FormerBuildings & former_buildings)
+ const BuildingDescr::FormerBuildings & former_buildings)
{
Map & map = egbase().map();
if (!former_buildings.empty()) {
Building_Index idx = former_buildings.back();
- const Building_Descr * descr = tribe().get_building_descr(idx);
+ const BuildingDescr * descr = tribe().get_building_descr(idx);
terraform_for_building(egbase(), player_number(), location, descr);
}
FCoords flag_loc;
@@ -549,14 +549,14 @@
*/
Building * Player::build
(Coords c, Building_Index const idx, bool constructionsite,
- Building_Descr::FormerBuildings & former_buildings)
+ BuildingDescr::FormerBuildings & former_buildings)
{
int32_t buildcaps;
// Validate building type
if (idx >= tribe().get_nrbuildings())
return nullptr;
- const Building_Descr & descr = *tribe().get_building_descr(idx);
+ const BuildingDescr & descr = *tribe().get_building_descr(idx);
if (!descr.is_buildable())
return nullptr;
@@ -873,7 +873,7 @@
void Player::drop_soldier(PlayerImmovable & imm, Soldier & soldier) {
if (&imm.owner() != this)
return;
- if (soldier.descr().type() != Map_Object_Type::SOLDIER)
+ if (soldier.descr().type() != MapObjectType::SOLDIER)
return;
if (upcast(SoldierControl, ctrl, &imm))
ctrl->dropSoldier(soldier);
@@ -1034,7 +1034,7 @@
{ // map_object_descr[TCoords::None]
- const Map_Object_Descr * map_object_descr;
+ const MapObjectDescr * map_object_descr;
field.constructionsite.becomes = nullptr;
if (const BaseImmovable * base_immovable = f.field->get_immovable()) {
map_object_descr = &base_immovable->descr();
=== modified file 'src/logic/player.h'
--- src/logic/player.h 2014-07-23 14:49:10 +0000
+++ src/logic/player.h 2014-07-28 18:15:26 +0000
@@ -131,8 +131,8 @@
/// Per-player and per-field constructionsite information
struct Constructionsite_Information {
Constructionsite_Information() : becomes(nullptr), was(nullptr), totaltime(0), completedtime(0) {}
- const Building_Descr * becomes; // Also works as a marker telling whether there is a construction site.
- const Building_Descr * was; // only valid if "becomes" is an enhanced building.
+ const BuildingDescr * becomes; // Also works as a marker telling whether there is a construction site.
+ const BuildingDescr * was; // only valid if "becomes" is an enhanced building.
uint32_t totaltime;
uint32_t completedtime;
};
@@ -313,7 +313,7 @@
* Only valid when the player has seen this node (or maybe a nearby node
* if the immovable is big?). (Roads are not stored here.)
*/
- const Map_Object_Descr * map_object_descr[3];
+ const MapObjectDescr * map_object_descr[3];
/// Information for constructionsite's animation.
/// only valid, if there is a constructionsite on this node
=== modified file 'src/logic/playercommand.cc'
--- src/logic/playercommand.cc 2014-07-20 07:45:17 +0000
+++ src/logic/playercommand.cc 2014-07-28 18:15:26 +0000
@@ -48,7 +48,7 @@
// means that get_object will always return nullptr and all upcasts will fail -
// so the commands will never do anything when executed.
template<typename T>
-Serial get_object_serial_or_zero(uint32_t object_index, Map_Map_Object_Loader& mol) {
+Serial get_object_serial_or_zero(uint32_t object_index, MapMapObjectLoader& mol) {
if (!object_index)
return 0;
return mol.get<T>(object_index).serial();
@@ -140,7 +140,7 @@
*/
#define PLAYER_COMMAND_VERSION 2
void PlayerCommand::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_COMMAND_VERSION);
@@ -152,7 +152,7 @@
}
void PlayerCommand::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -193,7 +193,7 @@
}
#define PLAYER_CMD_BULLDOZE_VERSION 2
void Cmd_Bulldoze::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -212,7 +212,7 @@
}
}
void Cmd_Bulldoze::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_BULLDOZE_VERSION);
@@ -247,7 +247,7 @@
}
#define PLAYER_CMD_BUILD_VERSION 1
void Cmd_Build::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -264,7 +264,7 @@
}
void Cmd_Build::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_BUILD_VERSION);
@@ -296,7 +296,7 @@
}
#define PLAYER_CMD_BUILDFLAG_VERSION 1
void Cmd_BuildFlag::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -311,7 +311,7 @@
}
}
void Cmd_BuildFlag::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_BUILDFLAG_VERSION);
@@ -378,7 +378,7 @@
}
#define PLAYER_CMD_BUILDROAD_VERSION 1
void Cmd_BuildRoad::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -398,7 +398,7 @@
}
}
void Cmd_BuildRoad::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_BUILDROAD_VERSION);
@@ -437,7 +437,7 @@
#define PLAYER_CMD_FLAGACTION_VERSION 1
void Cmd_FlagAction::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -453,7 +453,7 @@
}
}
void Cmd_FlagAction::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_FLAGACTION_VERSION);
@@ -488,7 +488,7 @@
}
#define PLAYER_CMD_STOPBUILDING_VERSION 1
void Cmd_StartStopBuilding::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -503,7 +503,7 @@
}
}
void Cmd_StartStopBuilding::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_STOPBUILDING_VERSION);
@@ -539,7 +539,7 @@
#define PLAYER_CMD_SOLDIERPREFERENCE_VERSION 1
void Cmd_MilitarySiteSetSoldierPreference::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SOLDIERPREFERENCE_VERSION);
@@ -553,7 +553,7 @@
}
void Cmd_MilitarySiteSetSoldierPreference::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try
{
@@ -593,7 +593,7 @@
}
#define PLAYER_CMD_EXPEDITION_VERSION 1
void Cmd_StartOrCancelExpedition::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -608,7 +608,7 @@
}
}
void Cmd_StartOrCancelExpedition::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_EXPEDITION_VERSION);
@@ -644,7 +644,7 @@
}
#define PLAYER_CMD_ENHANCEBUILDING_VERSION 1
void Cmd_EnhanceBuilding::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -660,7 +660,7 @@
}
}
void Cmd_EnhanceBuilding::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_ENHANCEBUILDING_VERSION);
@@ -696,7 +696,7 @@
}
#define PLAYER_CMD_DISMANTLEBUILDING_VERSION 1
void Cmd_DismantleBuilding::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -711,7 +711,7 @@
}
}
void Cmd_DismantleBuilding::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_DISMANTLEBUILDING_VERSION);
@@ -745,7 +745,7 @@
}
#define PLAYER_CMD_EVICTWORKER_VERSION 1
void Cmd_EvictWorker::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -760,7 +760,7 @@
}
}
void Cmd_EvictWorker::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_EVICTWORKER_VERSION);
@@ -798,7 +798,7 @@
#define PLAYER_CMD_SHIP_SCOUT_DIRECTION_VERSION 1
void Cmd_ShipScoutDirection::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -814,7 +814,7 @@
}
}
void Cmd_ShipScoutDirection::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SHIP_SCOUT_DIRECTION_VERSION);
@@ -855,7 +855,7 @@
#define PLAYER_CMD_SHIP_CONSTRUCT_PORT_VERSION 1
void Cmd_ShipConstructPort::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -871,7 +871,7 @@
}
}
void Cmd_ShipConstructPort::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SHIP_CONSTRUCT_PORT_VERSION);
@@ -912,7 +912,7 @@
#define PLAYER_CMD_SHIP_EXPLORE_ISLAND_VERSION 1
void Cmd_ShipExploreIsland::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -927,7 +927,7 @@
}
}
void Cmd_ShipExploreIsland::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SHIP_EXPLORE_ISLAND_VERSION);
@@ -966,7 +966,7 @@
#define PLAYER_CMD_SHIP_SINK_VERSION 1
void Cmd_ShipSink::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -980,7 +980,7 @@
}
}
void Cmd_ShipSink::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SHIP_SINK_VERSION);
@@ -1016,7 +1016,7 @@
#define PLAYER_CMD_SHIP_CANCELEXPEDITION_VERSION 1
void Cmd_ShipCancelExpedition::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1030,7 +1030,7 @@
}
}
void Cmd_ShipCancelExpedition::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_SHIP_CANCELEXPEDITION_VERSION);
@@ -1070,7 +1070,7 @@
#define PLAYER_CMD_SETWAREPRIORITY_VERSION 1
void Cmd_SetWarePriority::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_SETWAREPRIORITY_VERSION);
@@ -1083,7 +1083,7 @@
}
void Cmd_SetWarePriority::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1146,7 +1146,7 @@
#define PLAYER_CMD_SETWAREMAXFILL_SIZE_VERSION 1
void Cmd_SetWareMaxFill::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_SETWAREMAXFILL_SIZE_VERSION);
@@ -1158,7 +1158,7 @@
}
void Cmd_SetWareMaxFill::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1201,7 +1201,7 @@
{}
void Cmd_ChangeTargetQuantity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
PlayerCommand::Write(fw, egbase, mos);
fw.Unsigned32(economy());
@@ -1210,7 +1210,7 @@
}
void Cmd_ChangeTargetQuantity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
PlayerCommand::Read(fr, egbase, mol);
@@ -1260,7 +1260,7 @@
#define PLAYER_CMD_SETWARETARGETQUANTITY_VERSION 2
void Cmd_SetWareTargetQuantity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_SETWARETARGETQUANTITY_VERSION);
Cmd_ChangeTargetQuantity::Write(fw, egbase, mos);
@@ -1268,7 +1268,7 @@
}
void Cmd_SetWareTargetQuantity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1327,14 +1327,14 @@
#define PLAYER_CMD_RESETWARETARGETQUANTITY_VERSION 1
void Cmd_ResetWareTargetQuantity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_RESETWARETARGETQUANTITY_VERSION);
Cmd_ChangeTargetQuantity::Write(fw, egbase, mos);
}
void Cmd_ResetWareTargetQuantity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1382,7 +1382,7 @@
#define PLAYER_CMD_SETWORKERTARGETQUANTITY_VERSION 2
void Cmd_SetWorkerTargetQuantity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_SETWORKERTARGETQUANTITY_VERSION);
Cmd_ChangeTargetQuantity::Write(fw, egbase, mos);
@@ -1390,7 +1390,7 @@
}
void Cmd_SetWorkerTargetQuantity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1449,14 +1449,14 @@
#define PLAYER_CMD_RESETWORKERTARGETQUANTITY_VERSION 1
void Cmd_ResetWorkerTargetQuantity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_CMD_RESETWORKERTARGETQUANTITY_VERSION);
Cmd_ChangeTargetQuantity::Write(fw, egbase, mos);
}
void Cmd_ResetWorkerTargetQuantity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1509,7 +1509,7 @@
#define PLAYER_CMD_CHANGETRAININGOPTIONS_VERSION 1
void Cmd_ChangeTrainingOptions::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1527,7 +1527,7 @@
}
void Cmd_ChangeTrainingOptions::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_CHANGETRAININGOPTIONS_VERSION);
@@ -1567,7 +1567,7 @@
#define PLAYER_CMD_DROPSOLDIER_VERSION 1
void Cmd_DropSoldier::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1584,7 +1584,7 @@
}
void Cmd_DropSoldier::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_DROPSOLDIER_VERSION);
@@ -1626,7 +1626,7 @@
#define PLAYER_CMD_CHANGESOLDIERCAPACITY_VERSION 1
void Cmd_ChangeSoldierCapacity::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1643,7 +1643,7 @@
}
void Cmd_ChangeSoldierCapacity::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_CHANGESOLDIERCAPACITY_VERSION);
@@ -1708,7 +1708,7 @@
#define PLAYER_CMD_ENEMYFLAGACTION_VERSION 3
void Cmd_EnemyFlagAction::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1727,7 +1727,7 @@
}
void Cmd_EnemyFlagAction::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
// First, write version
fw.Unsigned16(PLAYER_CMD_ENEMYFLAGACTION_VERSION);
@@ -1752,7 +1752,7 @@
#define PLAYER_MESSAGE_CMD_VERSION 1
void PlayerMessageCommand::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
const uint16_t packet_version = fr.Unsigned16();
@@ -1771,7 +1771,7 @@
}
void PlayerMessageCommand::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned16(PLAYER_MESSAGE_CMD_VERSION);
PlayerCommand::Write(fw, egbase, mos);
@@ -1902,7 +1902,7 @@
#define PLAYER_CMD_SETSTOCKPOLICY_VERSION 1
void Cmd_SetStockPolicy::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint8_t version = fr.Unsigned8();
@@ -1919,7 +1919,7 @@
}
void Cmd_SetStockPolicy::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fw.Unsigned8(PLAYER_CMD_SETSTOCKPOLICY_VERSION);
PlayerCommand::Write(fw, egbase, mos);
=== modified file 'src/logic/playercommand.h'
--- src/logic/playercommand.h 2014-07-26 10:43:23 +0000
+++ src/logic/playercommand.h 2014-07-28 18:15:26 +0000
@@ -56,8 +56,8 @@
static Widelands::PlayerCommand * deserialize (StreamRead &);
// Call these from child classes
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
private:
Player_Number m_sender;
@@ -75,8 +75,8 @@
Cmd_Bulldoze (StreamRead &);
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_BULLDOZE;}
@@ -100,8 +100,8 @@
Cmd_Build (StreamRead &);
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_BUILD;}
@@ -121,8 +121,8 @@
Cmd_BuildFlag (StreamRead &);
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_FLAG;}
@@ -141,8 +141,8 @@
virtual ~Cmd_BuildRoad ();
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_BUILDROAD;}
@@ -162,8 +162,8 @@
PlayerCommand(t, p), serial(f.serial())
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_FLAGACTION;}
@@ -183,8 +183,8 @@
: PlayerCommand(t, p), serial(b.serial())
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_STOPBUILDING;}
@@ -203,8 +203,8 @@
: PlayerCommand(t, p), serial(b.serial()), preference(prefs)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_MILITARYSITESETSOLDIERPREFERENCE;}
@@ -223,8 +223,8 @@
: PlayerCommand(t, p), serial(b.serial())
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_PORT_START_EXPEDITION;}
@@ -248,8 +248,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_ENHANCEBUILDING;}
@@ -272,8 +272,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_DISMANTLEBUILDING;}
@@ -295,8 +295,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_EVICTWORKER;}
@@ -316,8 +316,8 @@
: PlayerCommand(t, p), serial(s), dir(direction)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SHIP_SCOUT;}
@@ -338,8 +338,8 @@
: PlayerCommand(t, p), serial(s), coords(c)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SHIP_CONSTRUCT_PORT;}
@@ -360,8 +360,8 @@
: PlayerCommand(t, p), serial(s), clockwise(cw)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SHIP_EXPLORE;}
@@ -382,8 +382,8 @@
: PlayerCommand(t, p), serial(s)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SHIP_SINK;}
@@ -403,8 +403,8 @@
: PlayerCommand(t, p), serial(s)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SHIP_CANCELEXPEDITION;}
@@ -432,8 +432,8 @@
int32_t type, Ware_Index index, int32_t priority);
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SETWAREPRIORITY;}
@@ -457,8 +457,8 @@
Ware_Index, uint32_t maxfill);
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SETWAREMAXFILL;}
@@ -480,8 +480,8 @@
uint32_t economy, Ware_Index index);
// Write/Read these commands to/from a file (for savegames).
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
Cmd_ChangeTargetQuantity(StreamRead &);
@@ -505,8 +505,8 @@
uint32_t permanent);
// Write/Read these commands to/from a file (for savegames).
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SETWARETARGETQUANTITY;}
@@ -526,8 +526,8 @@
uint32_t economy, Ware_Index index);
// Write/Read these commands to/from a file (for savegames).
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_RESETWARETARGETQUANTITY;}
@@ -545,8 +545,8 @@
uint32_t permanent);
// Write/Read these commands to/from a file (for savegames).
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_SETWORKERTARGETQUANTITY;}
@@ -566,8 +566,8 @@
uint32_t economy, Ware_Index index);
// Write/Read these commands to/from a file (for savegames).
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_RESETWORKERTARGETQUANTITY;}
@@ -589,8 +589,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_CHANGETRAININGOPTIONS;}
@@ -616,8 +616,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_DROPSOLDIER;}
@@ -639,8 +639,8 @@
{}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_CHANGESOLDIERCAPACITY;}
@@ -662,8 +662,8 @@
}
// Write these commands to a file (for savegames)
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
uint8_t id() const override {return QUEUE_CMD_ENEMYFLAGACTION;}
@@ -685,8 +685,8 @@
: PlayerCommand(t, p), m_message_id(i)
{}
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
PlayerMessageCommand(StreamRead &);
@@ -746,8 +746,8 @@
// Savegame functions
Cmd_SetStockPolicy();
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) override;
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &) override;
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) override;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &) override;
private:
Serial m_warehouse;
=== modified file 'src/logic/production_program.cc'
--- src/logic/production_program.cc 2014-07-25 22:17:48 +0000
+++ src/logic/production_program.cc 2014-07-28 18:15:26 +0000
@@ -297,7 +297,7 @@
}
ProductionProgram::ActReturn::Site_Has::Site_Has
- (char * & parameters, const ProductionSite_Descr & descr)
+ (char * & parameters, const ProductionSiteDescr & descr)
{
try {
parse_ware_type_group(parameters, group, descr.tribe(), descr.inputs());
@@ -395,7 +395,7 @@
ProductionProgram::ActReturn::Condition * create_site_condition
- (char * & parameters, const ProductionSite_Descr & descr)
+ (char * & parameters, const ProductionSiteDescr & descr)
{
try {
if (match_force_skip(parameters, "has"))
@@ -428,7 +428,7 @@
ProductionProgram::ActReturn::Condition *
ProductionProgram::ActReturn::create_condition
- (char * & parameters, const ProductionSite_Descr & descr)
+ (char * & parameters, const ProductionSiteDescr & descr)
{
try {
if (match_force_skip(parameters, "not"))
@@ -450,7 +450,7 @@
ProductionProgram::ActReturn::ActReturn
- (char * parameters, const ProductionSite_Descr & descr)
+ (char * parameters, const ProductionSiteDescr & descr)
{
try {
if (match(parameters, "failed")) m_result = Failed;
@@ -580,7 +580,7 @@
ProductionProgram::ActCall::ActCall
- (char * parameters, const ProductionSite_Descr & descr)
+ (char * parameters, const ProductionSiteDescr & descr)
{
// Initialize with default handling methods.
m_handling_methods[Failed - 1] = Continue;
@@ -591,8 +591,8 @@
bool reached_end;
{
char const * const program_name = next_word(parameters, reached_end);
- const ProductionSite_Descr::Programs & programs = descr.programs();
- ProductionSite_Descr::Programs::const_iterator const it =
+ const ProductionSiteDescr::Programs & programs = descr.programs();
+ ProductionSiteDescr::Programs::const_iterator const it =
programs.find(program_name);
if (it == programs.end())
throw game_data_error
@@ -686,14 +686,14 @@
}
ProductionProgram::ActWorker::ActWorker(
- char* parameters, const std::string& production_program_name, ProductionSite_Descr* descr)
+ char* parameters, const std::string& production_program_name, ProductionSiteDescr* descr)
{
try {
m_program = parameters;
// Quote form "void ProductionSite::program_act(Game &)":
// "Always main worker is doing stuff"
- const Worker_Descr & main_worker_descr =
+ const WorkerDescr & main_worker_descr =
*descr->tribe().get_worker_descr(descr->working_positions()[0].first);
// This will fail unless the main worker has a program with the given
@@ -805,7 +805,7 @@
}
ProductionProgram::ActAnimate::ActAnimate(
- char* parameters, const std::string& directory, Profile& prof, ProductionSite_Descr* descr) {
+ char* parameters, const std::string& directory, Profile& prof, ProductionSiteDescr* descr) {
try {
bool reached_end;
char * const animation_name = next_word(parameters, reached_end);
@@ -843,7 +843,7 @@
ProductionProgram::ActConsume::ActConsume
- (char * parameters, const ProductionSite_Descr & descr)
+ (char * parameters, const ProductionSiteDescr & descr)
{
try {
const Tribe_Descr & tribe = descr.tribe();
@@ -964,7 +964,7 @@
ProductionProgram::ActProduce::ActProduce
- (char * parameters, const ProductionSite_Descr & descr)
+ (char * parameters, const ProductionSiteDescr & descr)
{
try {
const Tribe_Descr & tribe = descr.tribe();
@@ -1064,7 +1064,7 @@
ProductionProgram::ActRecruit::ActRecruit
- (char * parameters, const ProductionSite_Descr & descr)
+ (char * parameters, const ProductionSiteDescr & descr)
{
try {
const Tribe_Descr & tribe = descr.tribe();
@@ -1161,7 +1161,7 @@
ProductionProgram::ActMine::ActMine(
char* parameters, const World& world, const std::string& production_program_name,
- ProductionSite_Descr* descr)
+ ProductionSiteDescr* descr)
{
try {
bool reached_end;
@@ -1563,7 +1563,7 @@
}
ProductionProgram::ActConstruct::ActConstruct(
- char* parameters, const std::string& production_program_name, ProductionSite_Descr* descr) {
+ char* parameters, const std::string& production_program_name, ProductionSiteDescr* descr) {
try {
std::vector<std::string> params = split_string(parameters, " ");
@@ -1584,10 +1584,10 @@
}
}
-const Immovable_Descr & ProductionProgram::ActConstruct::get_construction_descr
+const ImmovableDescr & ProductionProgram::ActConstruct::get_construction_descr
(ProductionSite & psite) const
{
- const Immovable_Descr * descr = psite.descr().tribe().get_immovable_descr(objectname);
+ const ImmovableDescr * descr = psite.descr().tribe().get_immovable_descr(objectname);
if (!descr)
throw wexception("ActConstruct: immovable '%s' does not exist", objectname.c_str());
@@ -1598,7 +1598,7 @@
void ProductionProgram::ActConstruct::execute(Game & g, ProductionSite & psite) const
{
ProductionSite::State & state = psite.top_state();
- const Immovable_Descr & descr = get_construction_descr(psite);
+ const ImmovableDescr & descr = get_construction_descr(psite);
// Early check for no resources
const Buildcost & buildcost = descr.buildcost();
@@ -1670,7 +1670,7 @@
return false;
}
} else {
- const Immovable_Descr & descr = get_construction_descr(psite);
+ const ImmovableDescr & descr = get_construction_descr(psite);
remaining = descr.buildcost();
}
@@ -1712,7 +1712,7 @@
ProductionProgram::ProductionProgram(
const std::string& directory, Profile& prof, const std::string& _name,
const std::string& _descname, const World& world,
- ProductionSite_Descr* building)
+ ProductionSiteDescr* building)
: m_name(_name), m_descname(_descname) {
Section& program_s = prof.get_safe_section(_name.c_str());
while (Section::Value* const v = program_s.get_next_val()) {
=== modified file 'src/logic/production_program.h'
--- src/logic/production_program.h 2014-07-26 10:43:23 +0000
+++ src/logic/production_program.h 2014-07-28 18:15:26 +0000
@@ -41,8 +41,8 @@
namespace Widelands {
class Game;
-struct Immovable_Descr;
-struct ProductionSite_Descr;
+struct ImmovableDescr;
+struct ProductionSiteDescr;
class ProductionSite;
struct Tribe_Descr;
class Worker;
@@ -136,7 +136,7 @@
/// Note: If the execution reaches the end of the program. the return value
/// is implicitly set to Completed.
struct ActReturn : public Action {
- ActReturn(char * parameters, const ProductionSite_Descr &);
+ ActReturn(char * parameters, const ProductionSiteDescr &);
virtual ~ActReturn();
void execute(Game &, ProductionSite &) const override;
@@ -147,10 +147,10 @@
= 0;
};
static Condition * create_condition
- (char * & parameters, const ProductionSite_Descr &);
+ (char * & parameters, const ProductionSiteDescr &);
struct Negation : public Condition {
Negation
- (char * & parameters, const ProductionSite_Descr & descr)
+ (char * & parameters, const ProductionSiteDescr & descr)
: operand(create_condition(parameters, descr))
{}
virtual ~Negation();
@@ -182,7 +182,7 @@
/// wares, combining from any of the types specified, in its input
/// queues.
struct Site_Has : public Condition {
- Site_Has(char * & parameters, const ProductionSite_Descr &);
+ Site_Has(char * & parameters, const ProductionSiteDescr &);
bool evaluate(const ProductionSite &) const override;
std::string description(const Tribe_Descr &) const override;
private:
@@ -234,7 +234,7 @@
/// program (with the same effect as executing "return=skipped").
/// * If handling_method is "repeat", the command is repeated.
struct ActCall : public Action {
- ActCall(char * parameters, const ProductionSite_Descr &);
+ ActCall(char * parameters, const ProductionSiteDescr &);
void execute(Game &, ProductionSite &) const override;
private:
ProductionProgram * m_program;
@@ -251,7 +251,7 @@
struct ActWorker : public Action {
ActWorker(char* parameters,
const std::string& production_program_name,
- ProductionSite_Descr*);
+ ProductionSiteDescr*);
void execute(Game &, ProductionSite &) const override;
bool get_building_work(Game &, ProductionSite &, Worker &) const override;
void building_work_failed(Game &, ProductionSite &, Worker &) const override;
@@ -314,7 +314,7 @@
/// animation will not be stopped by this command. It will run until another
/// animation is started.)
struct ActAnimate : public Action {
- ActAnimate(char* parameters, const std::string& directory, Profile&, ProductionSite_Descr*);
+ ActAnimate(char* parameters, const std::string& directory, Profile&, ProductionSiteDescr*);
void execute(Game &, ProductionSite &) const override;
private:
uint32_t m_id;
@@ -365,7 +365,7 @@
/// types of a group are sorted.
// TODO(unknown): change this!
struct ActConsume : public Action {
- ActConsume(char * parameters, const ProductionSite_Descr &);
+ ActConsume(char * parameters, const ProductionSiteDescr &);
void execute(Game &, ProductionSite &) const override;
typedef std::vector<Ware_Type_Group> Groups;
const Groups & groups() const {return m_groups;}
@@ -389,7 +389,7 @@
/// produced wares are of the type specified in the group. How the produced
/// wares are handled is defined by the productionsite.
struct ActProduce : public Action {
- ActProduce(char * parameters, const ProductionSite_Descr &);
+ ActProduce(char * parameters, const ProductionSiteDescr &);
void execute(Game &, ProductionSite &) const override;
bool get_building_work(Game &, ProductionSite &, Worker &) const override;
typedef std::vector<std::pair<Ware_Index, uint8_t> > Items;
@@ -414,7 +414,7 @@
/// The recruited workers are of the type specified in the group. How the
/// recruited workers are handled is defined by the productionsite.
struct ActRecruit : public Action {
- ActRecruit(char * parameters, const ProductionSite_Descr &);
+ ActRecruit(char * parameters, const ProductionSiteDescr &);
void execute(Game &, ProductionSite &) const override;
bool get_building_work(Game &, ProductionSite &, Worker &) const override;
typedef std::vector<std::pair<Ware_Index, uint8_t> > Items;
@@ -427,7 +427,7 @@
ActMine(char* parameters,
const World&,
const std::string& production_program_name,
- ProductionSite_Descr*);
+ ProductionSiteDescr*);
void execute(Game &, ProductionSite &) const override;
virtual void notify_player(Game &, ProductionSite &) const;
private:
@@ -493,12 +493,12 @@
struct ActConstruct : public Action {
ActConstruct(char* parameters,
const std::string& production_program_name,
- ProductionSite_Descr*);
+ ProductionSiteDescr*);
void execute(Game &, ProductionSite &) const override;
bool get_building_work(Game &, ProductionSite &, Worker &) const override;
void building_work_failed(Game &, ProductionSite &, Worker &) const override;
- const Immovable_Descr & get_construction_descr(ProductionSite &) const;
+ const ImmovableDescr & get_construction_descr(ProductionSite &) const;
private:
std::string objectname;
@@ -511,7 +511,7 @@
const std::string& name,
const std::string& descname,
const World&,
- ProductionSite_Descr*);
+ ProductionSiteDescr*);
~ProductionProgram() {
for (Action * action : m_actions) {
delete action;
=== modified file 'src/logic/productionsite.cc'
--- src/logic/productionsite.cc 2014-07-26 09:48:21 +0000
+++ src/logic/productionsite.cc 2014-07-28 18:15:26 +0000
@@ -53,12 +53,12 @@
==============================================================================
*/
-ProductionSite_Descr::ProductionSite_Descr
- (Map_Object_Type type, char const * const _name, char const * const _descname,
+ProductionSiteDescr::ProductionSiteDescr
+ (MapObjectType type, char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe, const World& world)
:
- Building_Descr(type, _name, _descname, directory, prof, global_s, _tribe)
+ BuildingDescr(type, _name, _descname, directory, prof, global_s, _tribe)
{
Section * const section = prof.get_section("out_of_resource_notification");
if (section != nullptr)
@@ -152,7 +152,7 @@
}
}
-ProductionSite_Descr::~ProductionSite_Descr()
+ProductionSiteDescr::~ProductionSiteDescr()
{
while (m_programs.size()) {
delete m_programs.begin()->second;
@@ -164,7 +164,7 @@
/**
* Get the program of the given name.
*/
-const ProductionProgram * ProductionSite_Descr::get_program
+const ProductionProgram * ProductionSiteDescr::get_program
(const std::string & program_name) const
{
Programs::const_iterator const it = programs().find(program_name);
@@ -177,7 +177,7 @@
/**
* Create a new building of this type
*/
-Building & ProductionSite_Descr::create_object() const {
+Building & ProductionSiteDescr::create_object() const {
return *new ProductionSite(*this);
}
@@ -190,7 +190,7 @@
==============================
*/
-ProductionSite::ProductionSite(const ProductionSite_Descr & ps_descr) :
+ProductionSite::ProductionSite(const ProductionSiteDescr & ps_descr) :
Building (ps_descr),
m_working_positions (new Working_Position[ps_descr.nr_working_positions()]),
m_fetchfromflag (0),
@@ -251,7 +251,7 @@
bool ProductionSite::has_workers(Building_Index targetSite, Game & /* game */)
{
// bld holds the description of the building we want to have
- if (upcast(ProductionSite_Descr const, bld, descr().tribe().get_building_descr(targetSite))) {
+ if (upcast(ProductionSiteDescr const, bld, descr().tribe().get_building_descr(targetSite))) {
// if he has workers
if (bld->nr_working_positions()) {
Ware_Index need = bld->working_positions()[0].first;
@@ -435,7 +435,7 @@
* returns 0 on success -1 if there is no room for this worker
*/
int ProductionSite::warp_worker
- (Editor_Game_Base & egbase, const Worker_Descr & wdes)
+ (Editor_Game_Base & egbase, const WorkerDescr & wdes)
{
bool assigned = false;
Working_Position * current = m_working_positions;
@@ -571,7 +571,7 @@
Ware_Index nuwo = psite.descr().tribe().get_nrworkers();
Ware_Index current = Ware_Index(static_cast<size_t>(0));
for (; current < nuwo; ++current) {
- Worker_Descr const * worker = psite.descr().tribe().get_worker_descr(current);
+ WorkerDescr const * worker = psite.descr().tribe().get_worker_descr(current);
if (worker->becomes() == idx) {
idx = current;
break;
@@ -765,7 +765,7 @@
std::pair<Ware_Index, uint8_t> & worker_type_with_count =
*m_recruited_workers.rbegin();
{
- const Worker_Descr & worker_descr =
+ const WorkerDescr & worker_descr =
*descr().tribe().get_worker_descr(worker_type_with_count.first);
{
Worker & recruit =
=== modified file 'src/logic/productionsite.h'
--- src/logic/productionsite.h 2014-07-26 10:43:23 +0000
+++ src/logic/productionsite.h 2014-07-28 18:15:26 +0000
@@ -39,7 +39,7 @@
class Soldier;
class Request;
class WaresQueue;
-class Worker_Descr;
+class WorkerDescr;
/**
@@ -52,14 +52,14 @@
* A production site can have one (or more) input wares types. Every input
* wares type has an associated store.
*/
-struct ProductionSite_Descr : public Building_Descr {
+struct ProductionSiteDescr : public BuildingDescr {
friend struct ProductionProgram; // To add animations
- ProductionSite_Descr
- (Map_Object_Type type, char const * name, char const * descname,
+ ProductionSiteDescr
+ (MapObjectType type, char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &, const World&);
- ~ProductionSite_Descr() override;
+ ~ProductionSiteDescr() override;
Building & create_object() const override;
@@ -108,7 +108,7 @@
std::string m_out_of_resource_message;
uint32_t m_out_of_resource_delay_attempts;
- DISALLOW_COPY_AND_ASSIGN(ProductionSite_Descr);
+ DISALLOW_COPY_AND_ASSIGN(ProductionSiteDescr);
};
class ProductionSite : public Building {
@@ -128,10 +128,10 @@
friend struct ProductionProgram::ActTrain;
friend struct ProductionProgram::ActPlayFX;
friend struct ProductionProgram::ActConstruct;
- MO_DESCR(ProductionSite_Descr)
+ MO_DESCR(ProductionSiteDescr)
public:
- ProductionSite(const ProductionSite_Descr & descr);
+ ProductionSite(const ProductionSiteDescr & descr);
virtual ~ProductionSite();
void log_general_info(const Editor_Game_Base &) override;
@@ -164,7 +164,7 @@
void act(Game &, uint32_t data) override;
void remove_worker(Worker &) override;
- int warp_worker(Editor_Game_Base &, const Worker_Descr & wd);
+ int warp_worker(Editor_Game_Base &, const WorkerDescr & wd);
bool fetch_from_flag(Game &) override;
bool get_building_work(Game &, Worker &, bool success) override;
=== modified file 'src/logic/queue_cmd_factory.cc'
--- src/logic/queue_cmd_factory.cc 2014-07-03 07:36:22 +0000
+++ src/logic/queue_cmd_factory.cc 2014-07-28 18:15:26 +0000
@@ -82,7 +82,7 @@
case QUEUE_CMD_MESSAGESETSTATUSARCHIVED:
return *new Cmd_MessageSetStatusArchived ();
case QUEUE_CMD_DESTROY_MAPOBJECT:
- return *new Cmd_Destroy_Map_Object ();
+ return *new CmdDestroyMapObject ();
case QUEUE_CMD_ACT:
return *new Cmd_Act ();
case QUEUE_CMD_INCORPORATE:
=== modified file 'src/logic/requirements.cc'
--- src/logic/requirements.cc 2014-07-25 20:40:51 +0000
+++ src/logic/requirements.cc 2014-07-28 18:15:26 +0000
@@ -28,7 +28,7 @@
namespace Widelands {
-bool Requirements::check(const Map_Object & obj) const
+bool Requirements::check(const MapObject & obj) const
{
return !m || m->check(obj);
}
@@ -39,7 +39,7 @@
* Read this requirement from a file
*/
void Requirements::Read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -54,7 +54,7 @@
}
void Requirements::Write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
const
{
fw.Unsigned16(REQUIREMENTS_VERSION);
@@ -86,7 +86,7 @@
}
Requirements RequirementsStorage::read
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
uint32_t const id = fr.Unsigned16();
@@ -114,7 +114,7 @@
m.push_back(req);
}
-bool RequireOr::check(const Map_Object & obj) const
+bool RequireOr::check(const MapObject & obj) const
{
for (const Requirements& req : m) {
if (req.check(obj)) {
@@ -126,7 +126,7 @@
}
void RequireOr::write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
const
{
assert(m.size() == static_cast<uint16_t>(m.size()));
@@ -138,7 +138,7 @@
}
static Requirements readOr
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
uint32_t const count = fr.Unsigned16();
RequireOr req;
@@ -160,7 +160,7 @@
m.push_back(req);
}
-bool RequireAnd::check(const Map_Object & obj) const
+bool RequireAnd::check(const MapObject & obj) const
{
for (const Requirements& req : m) {
if (!req.check(obj)) {
@@ -171,7 +171,7 @@
}
void RequireAnd::write
- (FileWrite & fw, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
const
{
assert(m.size() == static_cast<uint16_t>(m.size()));
@@ -183,7 +183,7 @@
}
static Requirements readAnd
- (FileRead & fr, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol)
+ (FileRead & fr, Editor_Game_Base & egbase, MapMapObjectLoader & mol)
{
uint32_t const count = fr.Unsigned16();
RequireAnd req;
@@ -200,7 +200,7 @@
const RequirementsStorage RequireAnd::storage(requirementIdAnd, readAnd);
-bool RequireAttribute::check(const Map_Object & obj) const
+bool RequireAttribute::check(const MapObject & obj) const
{
if (atrTotal != at)
{
@@ -220,7 +220,7 @@
}
void RequireAttribute::write
- (FileWrite & fw, Editor_Game_Base &, Map_Map_Object_Saver &) const
+ (FileWrite & fw, Editor_Game_Base &, MapMapObjectSaver &) const
{
fw.Unsigned32(at);
fw.Signed32(min);
@@ -228,7 +228,7 @@
}
static Requirements readAttribute
- (FileRead & fr, Editor_Game_Base &, Map_Map_Object_Loader &)
+ (FileRead & fr, Editor_Game_Base &, MapMapObjectLoader &)
{
tAttribute const at = static_cast<tAttribute>(fr.Unsigned32());
if
=== modified file 'src/logic/requirements.h'
--- src/logic/requirements.h 2014-07-05 16:41:51 +0000
+++ src/logic/requirements.h 2014-07-28 18:15:26 +0000
@@ -33,17 +33,17 @@
namespace Widelands {
-class Map_Object;
+class MapObject;
class Editor_Game_Base;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
struct RequirementsStorage;
/**
* Requirements can be attached to Requests.
*
- * Requirements are matched to a \ref Map_Object 's \ref tAttribute as
+ * Requirements are matched to a \ref MapObject 's \ref tAttribute as
* returned by \ref get_tattribute .
*/
struct Requirements {
@@ -51,9 +51,9 @@
struct BaseCapsule {
virtual ~BaseCapsule() {}
- virtual bool check(const Map_Object &) const = 0;
+ virtual bool check(const MapObject &) const = 0;
virtual void write
- (FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) const
+ (FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) const
= 0;
virtual const RequirementsStorage & storage() const = 0;
};
@@ -62,12 +62,12 @@
struct Capsule : public BaseCapsule {
Capsule(const T & _m) : m(_m) {}
- bool check(const Map_Object & obj) const override {return m.check(obj);}
+ bool check(const MapObject & obj) const override {return m.check(obj);}
void write
(FileWrite & fw,
Editor_Game_Base & egbase,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
const override
{
m.write(fw, egbase, mos);
@@ -86,11 +86,11 @@
/**
* \return \c true if the object satisfies the requirements.
*/
- bool check(const Map_Object &) const;
+ bool check(const MapObject &) const;
// For Save/Load Games
- void Read (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &);
- void Write(FileWrite &, Editor_Game_Base &, Map_Map_Object_Saver &) const;
+ void Read (FileRead &, Editor_Game_Base &, MapMapObjectLoader &);
+ void Write(FileWrite &, Editor_Game_Base &, MapMapObjectSaver &) const;
private:
boost::shared_ptr<BaseCapsule> m;
@@ -114,13 +114,13 @@
struct RequirementsStorage {
typedef
Requirements (*Reader)
- (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &);
+ (FileRead &, Editor_Game_Base &, MapMapObjectLoader &);
RequirementsStorage(uint32_t _id, Reader reader);
uint32_t id() const;
static Requirements read
- (FileRead &, Editor_Game_Base &, Map_Map_Object_Loader &);
+ (FileRead &, Editor_Game_Base &, MapMapObjectLoader &);
private:
typedef std::map<uint32_t, RequirementsStorage *> StorageMap;
@@ -139,9 +139,9 @@
struct RequireOr {
void add(const Requirements &);
- bool check(const Map_Object &) const;
+ bool check(const MapObject &) const;
void write
- (FileWrite &, Editor_Game_Base & egbase, Map_Map_Object_Saver &) const;
+ (FileWrite &, Editor_Game_Base & egbase, MapMapObjectSaver &) const;
static const RequirementsStorage storage;
@@ -157,9 +157,9 @@
struct RequireAnd {
void add(const Requirements &);
- bool check(const Map_Object &) const;
+ bool check(const MapObject &) const;
void write
- (FileWrite &, Editor_Game_Base & egbase, Map_Map_Object_Saver &) const;
+ (FileWrite &, Editor_Game_Base & egbase, MapMapObjectSaver &) const;
static const RequirementsStorage storage;
@@ -177,9 +177,9 @@
: at(_at), min(_min), max(_max) {}
RequireAttribute() : at(atrTotal), min(SHRT_MIN), max(SHRT_MAX) {}
- bool check(const Map_Object &) const;
+ bool check(const MapObject &) const;
void write
- (FileWrite &, Editor_Game_Base & egbase, Map_Map_Object_Saver &) const;
+ (FileWrite &, Editor_Game_Base & egbase, MapMapObjectSaver &) const;
static const RequirementsStorage storage;
=== modified file 'src/logic/ship.cc'
--- src/logic/ship.cc 2014-07-26 10:15:48 +0000
+++ src/logic/ship.cc 2014-07-28 18:15:26 +0000
@@ -49,12 +49,12 @@
namespace Widelands {
-Ship_Descr::Ship_Descr
+ShipDescr::ShipDescr
(const char * given_name, const char * gdescname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & gtribe)
:
- BobDescr(Map_Object_Type::SHIP, given_name, gdescname, >ribe)
+ BobDescr(MapObjectType::SHIP, given_name, gdescname, >ribe)
{
{ // global options
Section & idle_s = prof.get_safe_section("idle");
@@ -70,16 +70,16 @@
m_vision_range = global_s.get_natural("vision_range", 7);
}
-uint32_t Ship_Descr::movecaps() const {
+uint32_t ShipDescr::movecaps() const {
return MOVECAPS_SWIM;
}
-Bob & Ship_Descr::create_object() const {
+Bob & ShipDescr::create_object() const {
return *new Ship(*this);
}
-Ship::Ship(const Ship_Descr & gdescr) :
+Ship::Ship(const ShipDescr & gdescr) :
Bob(gdescr),
m_window(nullptr),
m_fleet(nullptr),
@@ -1036,8 +1036,8 @@
}
-Map_Object::Loader * Ship::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * Ship::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
std::unique_ptr<Loader> loader(new Loader);
@@ -1048,12 +1048,12 @@
if (1 <= version && version <= SHIP_SAVEGAME_VERSION) {
std::string owner = fr.CString();
std::string name = fr.CString();
- const Ship_Descr * descr = nullptr;
+ const ShipDescr * descr = nullptr;
egbase.manually_load_tribe(owner);
if (const Tribe_Descr * tribe = egbase.get_tribe(owner))
- descr = dynamic_cast<const Ship_Descr *>
+ descr = dynamic_cast<const ShipDescr *>
(tribe->get_bob_descr(name));
if (!descr)
@@ -1072,9 +1072,9 @@
}
void Ship::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Ship);
+ fw.Unsigned8(HeaderShip);
fw.Unsigned8(SHIP_SAVEGAME_VERSION);
fw.CString(descr().get_owner_tribe()->name());
=== modified file 'src/logic/ship.h'
--- src/logic/ship.h 2014-07-26 10:43:23 +0000
+++ src/logic/ship.h 2014-07-28 18:15:26 +0000
@@ -37,12 +37,12 @@
struct Fleet;
class PortDock;
-struct Ship_Descr : BobDescr {
- Ship_Descr
+struct ShipDescr : BobDescr {
+ ShipDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &);
- ~Ship_Descr() override {}
+ ~ShipDescr() override {}
Bob & create_object() const override;
@@ -57,7 +57,7 @@
DirAnimations m_sail_anims;
uint32_t m_capacity;
uint32_t m_vision_range;
- DISALLOW_COPY_AND_ASSIGN(Ship_Descr);
+ DISALLOW_COPY_AND_ASSIGN(ShipDescr);
};
/**
@@ -66,9 +66,9 @@
* are an economy of their own and are not part of a Fleet.
*/
struct Ship : Bob {
- MO_DESCR(Ship_Descr)
+ MO_DESCR(ShipDescr)
- Ship(const Ship_Descr & descr);
+ Ship(const ShipDescr & descr);
virtual ~Ship();
// Returns the fleet the ship is a part of.
@@ -251,10 +251,10 @@
};
public:
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &);
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &);
};
} // namespace Widelands
=== modified file 'src/logic/soldier.cc'
--- src/logic/soldier.cc 2014-07-26 09:48:21 +0000
+++ src/logic/soldier.cc 2014-07-28 18:15:26 +0000
@@ -71,14 +71,14 @@
constexpr int kRetreatWhenHealthDropsBelowThisPercentage = 50;
} // namespace
-Soldier_Descr::Soldier_Descr
+SoldierDescr::SoldierDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe)
:
- Worker_Descr(Map_Object_Type::SOLDIER, _name, _descname, directory, prof, global_s, _tribe)
+ WorkerDescr(MapObjectType::SOLDIER, _name, _descname, directory, prof, global_s, _tribe)
{
- add_attribute(Map_Object::Attribute::SOLDIER);
+ add_attribute(MapObject::Attribute::SOLDIER);
m_base_hp = global_s.get_safe_positive("hp");
@@ -193,7 +193,7 @@
}
-std::vector<std::string> Soldier_Descr::load_animations_from_string
+std::vector<std::string> SoldierDescr::load_animations_from_string
(const std::string & directory, Profile & prof,
Section & global_s, const char * anim_name)
{
@@ -227,7 +227,7 @@
/**
* Load the graphics
*/
-void Soldier_Descr::load_graphics() {
+void SoldierDescr::load_graphics() {
m_hp_pics .resize(m_max_hp_level + 1);
m_attack_pics .resize(m_max_attack_level + 1);
m_defense_pics.resize(m_max_defense_level + 1);
@@ -243,14 +243,14 @@
for (uint32_t i = 0; i <= m_max_evade_level; ++i)
m_evade_pics[i] =
g_gr->images().get(m_evade_pics_fn[i]);
- Worker_Descr::load_graphics();
+ WorkerDescr::load_graphics();
}
/**
* Get random animation of specified type
*/
-uint32_t Soldier_Descr::get_rand_anim
+uint32_t SoldierDescr::get_rand_anim
(Game & game, const char * const animation_name) const
{
std::string run = animation_name;
@@ -320,7 +320,7 @@
/**
* Create a new soldier
*/
-Bob & Soldier_Descr::create_object() const {return *new Soldier(*this);}
+Bob & SoldierDescr::create_object() const {return *new Soldier(*this);}
/*
==============================
@@ -331,7 +331,7 @@
*/
/// all done through init
-Soldier::Soldier(const Soldier_Descr & soldier_descr) : Worker(soldier_descr)
+Soldier::Soldier(const SoldierDescr & soldier_descr) : Worker(soldier_descr)
{
m_battle = nullptr;
m_hp_level = 0;
@@ -657,7 +657,7 @@
void Soldier::calc_info_icon_size
(const Tribe_Descr & tribe, uint32_t & w, uint32_t & h)
{
- const Soldier_Descr * soldierdesc = static_cast<const Soldier_Descr *>
+ const SoldierDescr * soldierdesc = static_cast<const SoldierDescr *>
(tribe.get_worker_descr(tribe.worker_index("soldier")));
const Image* hppic = soldierdesc->get_hp_level_pic(0);
const Image* attackpic = soldierdesc->get_attack_level_pic(0);
@@ -1910,7 +1910,7 @@
}
void Soldier::do_save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
Worker::do_save(egbase, mos, fw);
=== modified file 'src/logic/soldier.h'
--- src/logic/soldier.h 2014-07-26 10:43:23 +0000
+++ src/logic/soldier.h 2014-07-28 18:15:26 +0000
@@ -39,13 +39,13 @@
#define HP_FRAMECOLOR RGBColor(255, 255, 255)
-struct Soldier_Descr : public Worker_Descr {
+struct SoldierDescr : public WorkerDescr {
friend class Economy;
- Soldier_Descr
+ SoldierDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &);
- ~Soldier_Descr() override {}
+ ~SoldierDescr() override {}
void load_graphics() override;
@@ -130,7 +130,7 @@
const char * anim_name);
private:
- DISALLOW_COPY_AND_ASSIGN(Soldier_Descr);
+ DISALLOW_COPY_AND_ASSIGN(SoldierDescr);
};
class Building;
@@ -159,10 +159,10 @@
class Soldier : public Worker {
friend struct Map_Bobdata_Data_Packet;
- MO_DESCR(Soldier_Descr)
+ MO_DESCR(SoldierDescr)
public:
- Soldier(const Soldier_Descr &);
+ Soldier(const SoldierDescr &);
void init(Editor_Game_Base &) override;
void cleanup(Editor_Game_Base &) override;
@@ -307,7 +307,7 @@
public:
virtual void do_save
- (Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ (Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
};
}
=== modified file 'src/logic/tattribute.h'
--- src/logic/tattribute.h 2014-07-05 16:41:51 +0000
+++ src/logic/tattribute.h 2014-07-28 18:15:26 +0000
@@ -23,7 +23,7 @@
namespace Widelands {
/**
- * Indices for specific, individual attributes that \ref Map_Object instances
+ * Indices for specific, individual attributes that \ref MapObject instances
* may have. Used in conjunction with \ref Requirements.
*/
enum tAttribute {
=== modified file 'src/logic/trainingsite.cc'
--- src/logic/trainingsite.cc 2014-07-26 10:15:48 +0000
+++ src/logic/trainingsite.cc 2014-07-28 18:15:26 +0000
@@ -39,13 +39,13 @@
const uint32_t TrainingSite::training_state_multiplier = 12;
-TrainingSite_Descr::TrainingSite_Descr
+TrainingSiteDescr::TrainingSiteDescr
(char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe, const World& world)
:
- ProductionSite_Descr
- (Map_Object_Type::TRAININGSITE, _name, _descname, directory, prof, global_s, _tribe, world),
+ ProductionSiteDescr
+ (MapObjectType::TRAININGSITE, _name, _descname, directory, prof, global_s, _tribe, world),
m_num_soldiers (global_s.get_safe_int("soldier_capacity")),
m_max_stall (global_s.get_safe_int("trainer_patience")),
@@ -93,7 +93,7 @@
* Create a new training site
* \return the new training site
*/
-Building & TrainingSite_Descr::create_object() const {
+Building & TrainingSiteDescr::create_object() const {
return *new TrainingSite(*this);
}
@@ -102,7 +102,7 @@
* \return the minimum level to which this building can downgrade a
* specified attribute
*/
-int32_t TrainingSite_Descr::get_min_level(const tAttribute at) const {
+int32_t TrainingSiteDescr::get_min_level(const tAttribute at) const {
switch (at) {
case atrHP:
return m_min_hp;
@@ -123,7 +123,7 @@
* \param at the attribute to investigate
* \return the maximum level to be attained at this site
*/
-int32_t TrainingSite_Descr::get_max_level(const tAttribute at) const {
+int32_t TrainingSiteDescr::get_max_level(const tAttribute at) const {
switch (at) {
case atrHP:
return m_max_hp;
@@ -139,7 +139,7 @@
}
int32_t
-TrainingSite_Descr::get_max_stall() const
+TrainingSiteDescr::get_max_stall() const
{
return m_max_stall;
}
@@ -152,7 +152,7 @@
=============================
*/
-TrainingSite::TrainingSite(const TrainingSite_Descr & d) :
+TrainingSite::TrainingSite(const TrainingSiteDescr & d) :
ProductionSite (d),
m_soldier_request(nullptr),
m_capacity (descr().get_max_number_of_soldiers()),
@@ -177,7 +177,7 @@
init_kick_state(atrEvade, d);
}
void
-TrainingSite::init_kick_state(const tAttribute & art, const TrainingSite_Descr & d)
+TrainingSite::init_kick_state(const tAttribute & art, const TrainingSiteDescr & d)
{
// Now with kick-out state saving implemented, initializing is an overkill
for (int t = d.get_min_level(art); t <= d.get_max_level(art); t++)
=== modified file 'src/logic/trainingsite.h'
--- src/logic/trainingsite.h 2014-07-26 10:43:23 +0000
+++ src/logic/trainingsite.h 2014-07-28 18:15:26 +0000
@@ -31,12 +31,12 @@
class World;
-struct TrainingSite_Descr : public ProductionSite_Descr {
- TrainingSite_Descr
+struct TrainingSiteDescr : public ProductionSiteDescr {
+ TrainingSiteDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr & tribe, const World& world);
- ~TrainingSite_Descr() override {}
+ ~TrainingSiteDescr() override {}
Building & create_object() const override;
@@ -90,7 +90,7 @@
// Re-use of m_inputs to get the resources
// TrainingMap m_programs;
- DISALLOW_COPY_AND_ASSIGN(TrainingSite_Descr);
+ DISALLOW_COPY_AND_ASSIGN(TrainingSiteDescr);
};
/**
@@ -103,7 +103,7 @@
*/
class TrainingSite : public ProductionSite, public SoldierControl {
friend class Map_Buildingdata_Data_Packet;
- MO_DESCR(TrainingSite_Descr)
+ MO_DESCR(TrainingSiteDescr)
friend struct ::TrainingSite_Window;
struct Upgrade {
@@ -120,7 +120,7 @@
};
public:
- TrainingSite(const TrainingSite_Descr &);
+ TrainingSite(const TrainingSiteDescr &);
std::string get_statistics_string() override;
@@ -215,7 +215,7 @@
typedef std::map<TypeAndLevel_t, FailAndPresence_t> TrainFailCount_t;
TrainFailCount_t training_failure_count;
uint32_t max_stall_val;
- void init_kick_state(const tAttribute&, const TrainingSite_Descr&);
+ void init_kick_state(const tAttribute&, const TrainingSiteDescr&);
};
=== modified file 'src/logic/tribe.cc'
--- src/logic/tribe.cc 2014-07-26 09:48:21 +0000
+++ src/logic/tribe.cc 2014-07-28 18:15:26 +0000
@@ -80,7 +80,7 @@
PARSE_MAP_OBJECT_TYPES_BEGIN("ship")
m_bobs.add
- (new Ship_Descr
+ (new ShipDescr
(_name, _descname, path, prof, global_s, *this));
PARSE_MAP_OBJECT_TYPES_END;
@@ -94,7 +94,7 @@
PARSE_MAP_OBJECT_TYPES_BEGIN("immovable")
m_immovables.add
- (new Immovable_Descr
+ (new ImmovableDescr
(_name, _descname, path, prof, global_s, this));
PARSE_MAP_OBJECT_TYPES_END;
@@ -106,13 +106,13 @@
m_worker_types_without_cost.push_back(worker_idx); \
PARSE_MAP_OBJECT_TYPES_END;
- PARSE_SPECIAL_WORKER_TYPES("carrier", Carrier_Descr);
- PARSE_SPECIAL_WORKER_TYPES("soldier", Soldier_Descr);
+ PARSE_SPECIAL_WORKER_TYPES("carrier", CarrierDescr);
+ PARSE_SPECIAL_WORKER_TYPES("soldier", SoldierDescr);
#define PARSE_WORKER_TYPES(name) \
PARSE_MAP_OBJECT_TYPES_BEGIN(name) \
auto& worker_descr = \
- *new Worker_Descr(Map_Object_Type::WORKER, _name, _descname, path, prof, global_s, *this); \
+ *new WorkerDescr(MapObjectType::WORKER, _name, _descname, path, prof, global_s, *this); \
Ware_Index const worker_idx = m_workers.add(&worker_descr); \
if (worker_descr.is_buildable() && worker_descr.buildcost().empty()) \
m_worker_types_without_cost.push_back(worker_idx); \
@@ -122,32 +122,32 @@
PARSE_MAP_OBJECT_TYPES_BEGIN("constructionsite")
m_buildings.add
- (new ConstructionSite_Descr
+ (new ConstructionSiteDescr
(_name, _descname, path, prof, global_s, *this));
PARSE_MAP_OBJECT_TYPES_END;
safe_building_index("constructionsite"); // Check that it is defined.
PARSE_MAP_OBJECT_TYPES_BEGIN("dismantlesite")
m_buildings.add
- (new DismantleSite_Descr
+ (new DismantleSiteDescr
(_name, _descname, path, prof, global_s, *this));
PARSE_MAP_OBJECT_TYPES_END;
safe_building_index("dismantlesite"); // Check that it is defined.
PARSE_MAP_OBJECT_TYPES_BEGIN("warehouse")
m_buildings.add
- (new Warehouse_Descr
+ (new WarehouseDescr
(_name, _descname, path, prof, global_s, *this));
PARSE_MAP_OBJECT_TYPES_END;
PARSE_MAP_OBJECT_TYPES_BEGIN("productionsite")
- m_buildings.add(new ProductionSite_Descr(
- Map_Object_Type::PRODUCTIONSITE, _name, _descname, path, prof, global_s, *this, world));
+ m_buildings.add(new ProductionSiteDescr(
+ MapObjectType::PRODUCTIONSITE, _name, _descname, path, prof, global_s, *this, world));
PARSE_MAP_OBJECT_TYPES_END;
PARSE_MAP_OBJECT_TYPES_BEGIN("militarysite")
m_buildings.add
- (new MilitarySite_Descr
+ (new MilitarySiteDescr
(_name, _descname, path, prof, global_s, *this, world));
PARSE_MAP_OBJECT_TYPES_END;
@@ -160,7 +160,7 @@
PARSE_MAP_OBJECT_TYPES_BEGIN("global militarysite")
m_buildings.add
- (new MilitarySite_Descr
+ (new MilitarySiteDescr
(_name, _descname, path, prof, global_s, *this, world));
PARSE_MAP_OBJECT_TYPES_END;
@@ -171,7 +171,7 @@
PARSE_MAP_OBJECT_TYPES_BEGIN("trainingsite")
m_buildings.add
- (new TrainingSite_Descr
+ (new TrainingSiteDescr
(_name, _descname, path, prof, global_s, *this, world));
PARSE_MAP_OBJECT_TYPES_END;
=== modified file 'src/logic/tribe.h'
--- src/logic/tribe.h 2014-07-14 19:24:12 +0000
+++ src/logic/tribe.h 2014-07-28 18:15:26 +0000
@@ -38,9 +38,9 @@
class Editor_Game_Base;
class ResourceDescription;
class Warehouse;
-class Worker_Descr;
+class WorkerDescr;
class World;
-struct Building_Descr;
+struct BuildingDescr;
struct Event;
struct WareDescr;
@@ -65,7 +65,7 @@
const std::string & name() const {return m_name;}
Ware_Index get_nrworkers() const {return m_workers.get_nitems();}
- Worker_Descr const * get_worker_descr(const Ware_Index& index) const {
+ WorkerDescr const * get_worker_descr(const Ware_Index& index) const {
return m_workers.get(index);
}
Ware_Index worker_index(const std::string & workername) const {
@@ -96,7 +96,7 @@
return m_buildings.get_nitems();
}
Building_Index safe_building_index(char const * name) const;
- Building_Descr const * get_building_descr(const Building_Index& index) const
+ BuildingDescr const * get_building_descr(const Building_Index& index) const
{
return m_buildings.get(index);
}
@@ -113,10 +113,10 @@
return m_immovables.get_index(l);
}
int32_t get_nr_immovables() {return m_immovables.get_nitems();}
- Immovable_Descr const * get_immovable_descr(int32_t const index) const {
+ ImmovableDescr const * get_immovable_descr(int32_t const index) const {
return m_immovables.get(index);
}
- Immovable_Descr const * get_immovable_descr(const std::string & imm_name) const {
+ ImmovableDescr const * get_immovable_descr(const std::string & imm_name) const {
return m_immovables.get(get_immovable_index(imm_name.c_str()));
}
int32_t get_bob(char const * const l) const {return m_bobs.get_index(l);}
@@ -178,10 +178,10 @@
uint32_t m_flag_animation_id;
uint32_t m_bob_vision_range;
- DescriptionMaintainer<Worker_Descr> m_workers;
- DescriptionMaintainer<Building_Descr> m_buildings;
+ DescriptionMaintainer<WorkerDescr> m_workers;
+ DescriptionMaintainer<BuildingDescr> m_buildings;
DescriptionMaintainer<WareDescr> m_wares;
- DescriptionMaintainer<Immovable_Descr> m_immovables; // The player immovables
+ DescriptionMaintainer<ImmovableDescr> m_immovables; // The player immovables
DescriptionMaintainer<BobDescr> m_bobs;
std::string m_carrier2;
// Order and positioning of wares in the warehouse display
=== modified file 'src/logic/ware_descr.cc'
--- src/logic/ware_descr.cc 2014-07-26 09:48:21 +0000
+++ src/logic/ware_descr.cc 2014-07-28 18:15:26 +0000
@@ -32,7 +32,7 @@
char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s)
:
- Map_Object_Descr(Map_Object_Type::WARE, _name, _descname),
+ MapObjectDescr(MapObjectType::WARE, _name, _descname),
m_tribe (gtribe),
m_helptext (global_s.get_string("help", "")),
m_icon_fname (directory + "/menu.png"),
=== modified file 'src/logic/ware_descr.h'
--- src/logic/ware_descr.h 2014-07-26 10:43:23 +0000
+++ src/logic/ware_descr.h 2014-07-28 18:15:26 +0000
@@ -45,7 +45,7 @@
* Wares can be stored in warehouses. They can be transferred across an
* Economy. They can be traded.
*/
-struct WareDescr : public Map_Object_Descr {
+struct WareDescr : public MapObjectDescr {
WareDescr
(const Tribe_Descr & tribe, char const * const name,
char const * const descname, const std::string & directory,
=== modified file 'src/logic/warehouse.cc'
--- src/logic/warehouse.cc 2014-07-26 10:15:48 +0000
+++ src/logic/warehouse.cc 2014-07-28 18:15:26 +0000
@@ -252,10 +252,10 @@
/// Warehouse Descr
-Warehouse_Descr::Warehouse_Descr
+WarehouseDescr::WarehouseDescr
(char const* const _name, char const* const _descname,
const std::string& directory, Profile& prof, Section& global_s, const Tribe_Descr& _tribe)
- : Building_Descr(Map_Object_Type::WAREHOUSE, _name, _descname, directory, prof, global_s, _tribe),
+ : BuildingDescr(MapObjectType::WAREHOUSE, _name, _descname, directory, prof, global_s, _tribe),
m_conquers (0),
m_heal_per_second (0)
{
@@ -270,7 +270,7 @@
==============================
*/
-Warehouse::Warehouse(const Warehouse_Descr & warehouse_descr) :
+Warehouse::Warehouse(const WarehouseDescr & warehouse_descr) :
Building(warehouse_descr),
m_supply(new WarehouseSupply(this)),
m_next_military_act(0),
@@ -302,15 +302,15 @@
if (pw.index == INVALID_INDEX || !(pw.index < m_supply->get_workers().get_nrwareids()))
return false;
- const Worker_Descr * w_desc = descr().tribe().get_worker_descr(pw.index);
+ const WorkerDescr * w_desc = descr().tribe().get_worker_descr(pw.index);
if (!w_desc || !w_desc->is_buildable())
return false;
- const Worker_Descr::Buildcost & cost = w_desc->buildcost();
+ const WorkerDescr::Buildcost & cost = w_desc->buildcost();
uint32_t idx = 0;
for
- (Worker_Descr::Buildcost::const_iterator cost_it = cost.begin();
+ (WorkerDescr::Buildcost::const_iterator cost_it = cost.begin();
cost_it != cost.end(); ++cost_it, ++idx)
{
WareWorker type;
@@ -809,7 +809,7 @@
// Create a new one
// NOTE: This code lies about the tAttributes of the new worker
m_supply->remove_workers(ware, 1);
- const Worker_Descr & workerdescr = *descr().tribe().get_worker_descr(ware);
+ const WorkerDescr & workerdescr = *descr().tribe().get_worker_descr(ware);
return workerdescr.create(game, owner(), this, m_position);
}
}
@@ -885,7 +885,7 @@
{
// Create a carrier
Ware_Index const carrierid = descr().tribe().worker_index("carrier");
- const Worker_Descr & workerdescr = *descr().tribe().get_worker_descr(carrierid);
+ const WorkerDescr & workerdescr = *descr().tribe().get_worker_descr(carrierid);
Worker & worker = workerdescr.create(game, owner(), this, m_position);
@@ -943,7 +943,7 @@
worker.schedule_incorporate(game);
}
-Building & Warehouse_Descr::create_object() const {
+Building & WarehouseDescr::create_object() const {
return *new Warehouse(*this);
}
@@ -954,7 +954,7 @@
("worker type %d does not exists (max is %d)",
worker, m_supply->get_workers().get_nrwareids());
- const Worker_Descr & w_desc = *descr().tribe().get_worker_descr(worker);
+ const WorkerDescr & w_desc = *descr().tribe().get_worker_descr(worker);
assert(&w_desc);
if (!w_desc.is_buildable())
return false;
@@ -983,7 +983,7 @@
void Warehouse::create_worker(Game & game, Ware_Index const worker) {
assert(can_create_worker (game, worker));
- const Worker_Descr & w_desc = *descr().tribe().get_worker_descr(worker);
+ const WorkerDescr & w_desc = *descr().tribe().get_worker_descr(worker);
for (const std::pair<std::string, uint8_t>& buildcost : w_desc.buildcost()) {
const std::string & input = buildcost.first;
@@ -1030,7 +1030,7 @@
std::vector<uint32_t> Warehouse::calc_available_for_worker
(Game & /* game */, Ware_Index index) const
{
- const Worker_Descr & w_desc = *descr().tribe().get_worker_descr(index);
+ const WorkerDescr & w_desc = *descr().tribe().get_worker_descr(index);
std::vector<uint32_t> available;
for (const std::pair<std::string, uint8_t>& buildcost : w_desc.buildcost()) {
@@ -1084,7 +1084,7 @@
pw->index = index;
pw->amount = 0;
- const Worker_Descr & w_desc = *descr().tribe().get_worker_descr(pw->index);
+ const WorkerDescr & w_desc = *descr().tribe().get_worker_descr(pw->index);
for (const std::pair<std::string, uint8_t>& buildcost : w_desc.buildcost()) {
const std::string & input_name = buildcost.first;
@@ -1114,7 +1114,7 @@
void Warehouse::_update_planned_workers
(Game & game, Warehouse::PlannedWorkers & pw)
{
- const Worker_Descr & w_desc = *descr().tribe().get_worker_descr(pw.index);
+ const WorkerDescr & w_desc = *descr().tribe().get_worker_descr(pw.index);
while (pw.amount && can_create_worker(game, pw.index)) {
create_worker(game, pw.index);
=== modified file 'src/logic/warehouse.h'
--- src/logic/warehouse.h 2014-07-26 10:43:23 +0000
+++ src/logic/warehouse.h 2014-07-28 18:15:26 +0000
@@ -48,12 +48,12 @@
*/
struct WarehouseSupply;
-struct Warehouse_Descr : public Building_Descr {
- Warehouse_Descr
+struct WarehouseDescr : public BuildingDescr {
+ WarehouseDescr
(char const * name, char const * descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &);
- ~Warehouse_Descr() override {}
+ ~WarehouseDescr() override {}
Building & create_object() const override;
@@ -66,7 +66,7 @@
private:
int32_t m_conquers;
uint32_t m_heal_per_second;
- DISALLOW_COPY_AND_ASSIGN(Warehouse_Descr);
+ DISALLOW_COPY_AND_ASSIGN(WarehouseDescr);
};
@@ -74,7 +74,7 @@
friend class PortDock;
friend class Map_Buildingdata_Data_Packet;
- MO_DESCR(Warehouse_Descr)
+ MO_DESCR(WarehouseDescr)
public:
/**
@@ -111,7 +111,7 @@
SP_Remove = 3,
};
- Warehouse(const Warehouse_Descr &);
+ Warehouse(const WarehouseDescr &);
virtual ~Warehouse();
void load_finish(Editor_Game_Base &) override;
=== modified file 'src/logic/widelands.h'
--- src/logic/widelands.h 2014-07-25 22:17:48 +0000
+++ src/logic/widelands.h 2014-07-28 18:15:26 +0000
@@ -61,7 +61,7 @@
typedef uint32_t Duration;
inline Duration Forever() {return 0xffffffff;}
-typedef uint32_t Serial; /// Serial number for Map_Object.
+typedef uint32_t Serial; /// Serial number for MapObject.
constexpr uint8_t INVALID_INDEX = std::numeric_limits<uint8_t>::max();
typedef uint8_t Ware_Index;
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc 2014-07-26 10:15:48 +0000
+++ src/logic/worker.cc 2014-07-28 18:15:26 +0000
@@ -37,7 +37,7 @@
#include "logic/carrier.h"
#include "logic/checkstep.h"
#include "logic/cmd_incorporate.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/dismantlesite.h"
#include "logic/findbob.h"
#include "logic/findimmovable.h"
@@ -611,7 +611,7 @@
// Determine the coords we need to walk towards
if (action.iparam1 & Action::walkObject) {
- Map_Object * const obj = state.objvar1.get(game);
+ MapObject * const obj = state.objvar1.get(game);
if (obj) {
if (upcast(Bob const, bob, obj))
@@ -705,7 +705,7 @@
*/
bool Worker::run_object(Game & game, State & state, const Action & action)
{
- Map_Object * const obj = state.objvar1.get(game);
+ MapObject * const obj = state.objvar1.get(game);
if (!obj) {
send_signal(game, "fail");
@@ -716,7 +716,7 @@
if (upcast(Immovable, immovable, obj))
immovable->switch_program(game, action.sparam1);
else if (upcast(Bob, bob, obj)) {
- if (upcast(Critter_Bob, crit, bob)) {
+ if (upcast(Critter, crit, bob)) {
crit->reset_tasks(game); // TODO(unknown): ask the critter more nicely
crit->start_task_program(game, action.sparam1);
} else if (upcast(Worker, w, bob)) {
@@ -778,7 +778,7 @@
// Checks if the 'immovable_description' has a terrain_affinity, if so use it. Otherwise assume it
// to be 1. (perfect fit). Adds it to the best_suited_immovables_index.
const auto test_suitability = [&best_suited_immovables_index, &fpos, &map, &game](
- const uint32_t index, const Immovable_Descr& immovable_description) {
+ const uint32_t index, const ImmovableDescr& immovable_description) {
double p = 1.;
if (immovable_description.has_terrain_affinity()) {
p = probability_to_grow(
@@ -803,11 +803,11 @@
if (list[0] == "attrib") {
state.svar1 = "world";
- const DescriptionMaintainer<Immovable_Descr>& immovables = game.world().immovables();
+ const DescriptionMaintainer<ImmovableDescr>& immovables = game.world().immovables();
- const uint32_t attribute_id = Immovable_Descr::get_attribute_id(list[1]);
+ const uint32_t attribute_id = ImmovableDescr::get_attribute_id(list[1]);
for (uint32_t i = 0; i < immovables.get_nitems(); ++i) {
- Immovable_Descr& immovable_descr = immovables.get_unmutable(i);
+ ImmovableDescr& immovable_descr = immovables.get_unmutable(i);
if (!immovable_descr.has_attribute(attribute_id)) {
continue;
}
@@ -818,7 +818,7 @@
uint32_t immovable_index = descr().tribe().get_immovable_index(list[1]);
if (immovable_index > 0) {
- const Immovable_Descr* imm = descr().tribe().get_immovable_descr(immovable_index);
+ const ImmovableDescr* imm = descr().tribe().get_immovable_descr(immovable_index);
test_suitability(immovable_index, *imm);
}
}
@@ -866,7 +866,7 @@
*/
bool Worker::run_removeobject(Game & game, State & state, const Action &)
{
- if (Map_Object * const obj = state.objvar1.get(game)) {
+ if (MapObject * const obj = state.objvar1.get(game)) {
obj->remove(game);
state.objvar1 = nullptr;
}
@@ -1016,7 +1016,7 @@
}
-Worker::Worker(const Worker_Descr & worker_descr)
+Worker::Worker(const WorkerDescr & worker_descr)
:
Bob (worker_descr),
m_economy (nullptr),
@@ -1093,7 +1093,7 @@
if (location) {
Economy * const eco = location->get_economy();
- if (!m_economy || (descr().type() == Map_Object_Type::SOLDIER)) {
+ if (!m_economy || (descr().type() == MapObjectType::SOLDIER)) {
set_economy(eco);
} else if (m_economy != eco) {
throw wexception
@@ -1315,7 +1315,7 @@
if (PlayerImmovable * location = get_location(game)) {
if
(get_economy()->warehouses().size() ||
- location->descr().type() >= Map_Object_Type::BUILDING)
+ location->descr().type() >= MapObjectType::BUILDING)
return start_task_gowarehouse(game);
set_location(nullptr);
@@ -1500,7 +1500,7 @@
serial(), nextstep->serial());
} else if (upcast(Road, road, location)) {
// Road to Flag
- if (nextstep->descr().type() == Map_Object_Type::FLAG) {
+ if (nextstep->descr().type() == MapObjectType::FLAG) {
const Path & path = road->get_path();
int32_t const index =
nextstep == &road->get_flag(Road::FlagStart) ? 0 :
@@ -1749,7 +1749,7 @@
{
PlayerImmovable * const location = get_location(game);
- if (!location || location->descr().type() < Map_Object_Type::BUILDING)
+ if (!location || location->descr().type() < MapObjectType::BUILDING)
throw wexception
("MO(%u): start_task_return(): not owned by building", serial());
@@ -1908,7 +1908,7 @@
set_program_objvar(game, state, nullptr);
}
-void Worker::set_program_objvar(Game & game, State & state, Map_Object * obj)
+void Worker::set_program_objvar(Game & game, State & state, MapObject * obj)
{
assert(state.task == &taskProgram);
@@ -1991,7 +1991,7 @@
// Always leave buildings in an orderly manner,
// even when no warehouses are left to return to
- if (location->descr().type() >= Map_Object_Type::BUILDING)
+ if (location->descr().type() >= MapObjectType::BUILDING)
return start_task_leavebuilding(game, true);
if (!get_economy()->warehouses().size()) {
@@ -2108,7 +2108,7 @@
}
// We don't have the ware any more, return home
- if (location->descr().type() == Map_Object_Type::FLAG)
+ if (location->descr().type() == MapObjectType::FLAG)
return
start_task_move
(game,
@@ -2116,7 +2116,7 @@
descr().get_right_walk_anims(does_carry_ware()),
true);
- if (location->descr().type() < Map_Object_Type::BUILDING)
+ if (location->descr().type() < MapObjectType::BUILDING)
throw wexception
("MO(%u): [dropoff]: not on building on return", serial());
@@ -2425,8 +2425,8 @@
// The if-statement is needed because this is (unfortunately) also called
// when the Worker is deallocated when shutting down the simulation. Then
// the building might not exist any more.
- if (Map_Object * const building = state.objvar1.get(game))
- ref_cast<Building, Map_Object>(*building).leave_skip(game, *this);
+ if (MapObject * const building = state.objvar1.get(game))
+ ref_cast<Building, MapObject>(*building).leave_skip(game, *this);
}
@@ -3020,8 +3020,8 @@
* Derived classes must override \ref create_loader to make sure
* the appropriate actual load functions are called.
*/
-Map_Object::Loader * Worker::load
- (Editor_Game_Base & egbase, Map_Map_Object_Loader & mol, FileRead & fr)
+MapObject::Loader * Worker::load
+ (Editor_Game_Base & egbase, MapMapObjectLoader & mol, FileRead & fr)
{
try {
// header has already been read by caller
@@ -3034,7 +3034,7 @@
if (!tribe)
throw game_data_error("unknown tribe '%s'", tribename.c_str());
- const Worker_Descr * descr =
+ const WorkerDescr * descr =
tribe->get_worker_descr(tribe->safe_worker_index(name));
Worker * worker = static_cast<Worker *>(&descr->create_object());
@@ -3053,9 +3053,9 @@
* \warning Do not override this function, override \ref do_save instead.
*/
void Worker::save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
- fw.Unsigned8(header_Worker);
+ fw.Unsigned8(HeaderWorker);
fw.CString(descr().tribe().name());
fw.CString(descr().name());
@@ -3070,7 +3070,7 @@
* Override this function in derived classes.
*/
void Worker::do_save
- (Editor_Game_Base & egbase, Map_Map_Object_Saver & mos, FileWrite & fw)
+ (Editor_Game_Base & egbase, MapMapObjectSaver & mos, FileWrite & fw)
{
Bob::save(egbase, mos, fw);
=== modified file 'src/logic/worker.h'
--- src/logic/worker.h 2014-07-26 10:43:23 +0000
+++ src/logic/worker.h 2014-07-28 18:15:26 +0000
@@ -46,7 +46,7 @@
friend struct WorkerProgram;
friend struct Map_Bobdata_Data_Packet;
- MO_DESCR(Worker_Descr)
+ MO_DESCR(WorkerDescr)
struct Action {
typedef bool (Worker::*execute_t)(Game &, Bob::State &, const Action &);
@@ -74,7 +74,7 @@
public:
- Worker(const Worker_Descr &);
+ Worker(const WorkerDescr &);
virtual ~Worker();
Player & owner() const {assert(get_owner()); return *get_owner();}
@@ -176,7 +176,7 @@
bool does_carry_ware() {return m_carried_ware.is_set();}
- void set_program_objvar(Game &, State &, Map_Object * obj);
+ void set_program_objvar(Game &, State &, MapObject * obj);
public:
static const Task taskTransfer;
@@ -272,12 +272,12 @@
virtual Loader * create_loader();
public:
- void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &) override;
+ void save(Editor_Game_Base &, MapMapObjectSaver &, FileWrite &) override;
virtual void do_save
- (Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &);
+ (Editor_Game_Base &, MapMapObjectSaver &, FileWrite &);
- static Map_Object::Loader * load
- (Editor_Game_Base &, Map_Map_Object_Loader &, FileRead &);
+ static MapObject::Loader * load
+ (Editor_Game_Base &, MapMapObjectLoader &, FileRead &);
};
}
=== modified file 'src/logic/worker_descr.cc'
--- src/logic/worker_descr.cc 2014-07-26 09:48:21 +0000
+++ src/logic/worker_descr.cc 2014-07-28 18:15:26 +0000
@@ -35,8 +35,8 @@
namespace Widelands {
-Worker_Descr::Worker_Descr
- (const Map_Object_Type type, char const * const _name, char const * const _descname,
+WorkerDescr::WorkerDescr
+ (const MapObjectType type, char const * const _name, char const * const _descname,
const std::string & directory, Profile & prof, Section & global_s,
const Tribe_Descr & _tribe)
:
@@ -54,7 +54,7 @@
add_animation("idle", g_gr->animations().load(directory, idle_s));
}
- add_attribute(Map_Object::Attribute::WORKER);
+ add_attribute(MapObject::Attribute::WORKER);
m_default_target_quantity =
global_s.get_positive("default_target_quantity", std::numeric_limits<uint32_t>::max());
@@ -129,7 +129,7 @@
}
-Worker_Descr::~Worker_Descr()
+WorkerDescr::~WorkerDescr()
{
while (m_programs.size()) {
delete m_programs.begin()->second;
@@ -137,7 +137,7 @@
}
}
-const Tribe_Descr& Worker_Descr::tribe() const {
+const Tribe_Descr& WorkerDescr::tribe() const {
const Tribe_Descr* owner_tribe = get_owner_tribe();
assert(owner_tribe != nullptr);
return *owner_tribe;
@@ -146,7 +146,7 @@
/**
* Load graphics (other than animations).
*/
-void Worker_Descr::load_graphics()
+void WorkerDescr::load_graphics()
{
m_icon = g_gr->images().get(m_icon_fname);
}
@@ -155,7 +155,7 @@
/**
* Get a program from the workers description.
*/
-WorkerProgram const * Worker_Descr::get_program
+WorkerProgram const * WorkerDescr::get_program
(const std::string & programname) const
{
Programs::const_iterator it = m_programs.find(programname);
@@ -170,14 +170,14 @@
/**
* Custom creation routing that accounts for the location.
*/
-Worker & Worker_Descr::create
+Worker & WorkerDescr::create
(Editor_Game_Base & egbase,
Player & owner,
PlayerImmovable * const location,
Coords const coords)
const
{
- Worker & worker = ref_cast<Worker, Map_Object>(create_object());
+ Worker & worker = ref_cast<Worker, MapObject>(create_object());
worker.set_owner(&owner);
worker.set_location(location);
worker.set_position(egbase, coords);
@@ -186,13 +186,13 @@
}
-uint32_t Worker_Descr::movecaps() const {return MOVECAPS_WALK;}
+uint32_t WorkerDescr::movecaps() const {return MOVECAPS_WALK;}
/**
* Create a generic worker of this type.
*/
-Bob & Worker_Descr::create_object() const
+Bob & WorkerDescr::create_object() const
{
return *new Worker(*this);
}
@@ -201,18 +201,18 @@
/**
* check if worker can be substitute for a requested worker type
*/
-bool Worker_Descr::can_act_as(Ware_Index const index) const {
+bool WorkerDescr::can_act_as(Ware_Index const index) const {
assert(index < tribe().get_nrworkers());
if (index == worker_index())
return true;
// if requested worker type can be promoted, compare with that type
- const Worker_Descr & descr = *tribe().get_worker_descr(index);
+ const WorkerDescr & descr = *tribe().get_worker_descr(index);
Ware_Index const becomes_index = descr.becomes();
return becomes_index != INVALID_INDEX ? can_act_as(becomes_index) : false;
}
-Ware_Index Worker_Descr::worker_index() const {
+Ware_Index WorkerDescr::worker_index() const {
return tribe().worker_index(name());
}
=== modified file 'src/logic/worker_descr.h'
--- src/logic/worker_descr.h 2014-07-26 10:43:23 +0000
+++ src/logic/worker_descr.h 2014-07-28 18:15:26 +0000
@@ -35,7 +35,7 @@
struct WorkerProgram;
-class Worker_Descr : public BobDescr
+class WorkerDescr : public BobDescr
{
friend struct Tribe_Descr;
friend class Warehouse;
@@ -44,11 +44,11 @@
public:
typedef std::map<std::string, uint8_t> Buildcost;
- Worker_Descr
- (Map_Object_Type type, char const * const name, char const * const descname,
+ WorkerDescr
+ (MapObjectType type, char const * const name, char const * const descname,
const std::string & directory, Profile &, Section & global_s,
const Tribe_Descr &);
- ~Worker_Descr() override;
+ ~WorkerDescr() override;
Bob & create_object() const override;
@@ -101,7 +101,7 @@
Worker & create
(Editor_Game_Base &, Player &, PlayerImmovable *, Coords) const;
- typedef std::map<Worker_Descr const *, std::string> becomes_map_t;
+ typedef std::map<WorkerDescr const *, std::string> becomes_map_t;
uint32_t movecaps() const override;
typedef std::map<std::string, WorkerProgram *> Programs;
@@ -131,7 +131,7 @@
Ware_Index m_becomes;
Programs m_programs;
private:
- DISALLOW_COPY_AND_ASSIGN(Worker_Descr);
+ DISALLOW_COPY_AND_ASSIGN(WorkerDescr);
};
}
=== modified file 'src/logic/worker_program.cc'
--- src/logic/worker_program.cc 2014-04-21 18:18:01 +0000
+++ src/logic/worker_program.cc 2014-07-28 18:15:26 +0000
@@ -58,7 +58,7 @@
* Parse a program
*/
void WorkerProgram::parse
- (Worker_Descr * descr, Parser * parser, char const * const name)
+ (WorkerDescr * descr, Parser * parser, char const * const name)
{
Section & program_s = parser->prof->get_safe_section(name);
@@ -109,7 +109,7 @@
* iparam1 = ware index
*/
void WorkerProgram::parse_createware
- (Worker_Descr * descr,
+ (WorkerDescr * descr,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -131,7 +131,7 @@
* sparam1 = resource
*/
void WorkerProgram::parse_mine
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -158,7 +158,7 @@
* sparam1 = resource
*/
void WorkerProgram::parse_breed
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -185,7 +185,7 @@
* sparamv = possible bobs
*/
void WorkerProgram::parse_setdescription
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> &)
@@ -202,7 +202,7 @@
* sparamv = possible bobs
*/
void WorkerProgram::parse_setbobdescription
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -238,7 +238,7 @@
* sparam1 = type
*/
void WorkerProgram::parse_findobject
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -264,7 +264,7 @@
throw wexception("Bad findobject radius '%s'", value.c_str());
} else if (key == "attrib") {
- act->iparam2 = Map_Object_Descr::get_attribute_id(value);
+ act->iparam2 = MapObjectDescr::get_attribute_id(value);
} else if (key == "type") {
act->sparam1 = value;
} else
@@ -317,7 +317,7 @@
* sparam1 = Resource
*/
void WorkerProgram::parse_findspace
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -377,7 +377,7 @@
} else if (key == "space") {
act->iparam3 = 1;
} else if (key == "avoid") {
- act->iparam5 = Map_Object_Descr::get_attribute_id(value);
+ act->iparam5 = MapObjectDescr::get_attribute_id(value);
} else
throw wexception
("Bad findspace predicate %s:%s", key.c_str(), value.c_str());
@@ -402,7 +402,7 @@
* iparam1 = walkXXX
*/
void WorkerProgram::parse_walk
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -432,7 +432,7 @@
*
*/
void WorkerProgram::parse_animation
- (Worker_Descr * descr,
+ (WorkerDescr * descr,
Worker::Action * act,
Parser * parser,
const std::vector<std::string> & cmd)
@@ -468,7 +468,7 @@
* iparam1 = 0: don't drop ware on flag, 1: do drop ware on flag
*/
void WorkerProgram::parse_return
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> &)
@@ -486,7 +486,7 @@
* sparam1 = object command name
*/
void WorkerProgram::parse_object
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -509,7 +509,7 @@
* iparam1 one of plantXXX
*/
void WorkerProgram::parse_plant
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -541,7 +541,7 @@
* type must have been selected by a previous command (i.e. setbobdescription).
*/
void WorkerProgram::parse_create_bob
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> &)
@@ -554,7 +554,7 @@
* Simply remove the currently selected object - make no fuss about it.
*/
void WorkerProgram::parse_removeobject
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> &)
@@ -574,7 +574,7 @@
* sparam1 = subcommand
*/
void WorkerProgram::parse_geologist
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -603,7 +603,7 @@
* when possible.
*/
void WorkerProgram::parse_geologist_find
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -623,7 +623,7 @@
* iparam2 = time
*/
void WorkerProgram::parse_scout
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
@@ -637,7 +637,7 @@
}
void WorkerProgram::parse_playFX
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser * parser,
const std::vector<std::string> & cmd)
@@ -663,7 +663,7 @@
* for construction. This is used in ship building.
*/
void WorkerProgram::parse_construct
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action * act,
Parser *,
const std::vector<std::string> & cmd)
=== modified file 'src/logic/worker_program.h'
--- src/logic/worker_program.h 2014-07-23 14:49:10 +0000
+++ src/logic/worker_program.h 2014-07-28 18:15:26 +0000
@@ -28,17 +28,17 @@
// TODO(Antonio Trueba#1#): Get rid of forward class
// declaration (Chicken-and-egg problem)
-class Worker_Descr;
+class WorkerDescr;
struct WorkerProgram : public BobProgramBase {
struct Parser {
- Worker_Descr * descr;
+ WorkerDescr * descr;
std::string directory;
Profile * prof;
};
typedef void (WorkerProgram::*parse_t)
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> &);
@@ -56,7 +56,7 @@
return &m_actions[idx];
}
- void parse(Worker_Descr *, Parser *, char const * name);
+ void parse(WorkerDescr *, Parser *, char const * name);
const Workarea_Info & get_workarea_info() const {return m_workarea_info;}
private:
@@ -67,97 +67,97 @@
};
void parse_mine
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_breed
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_createware
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_setdescription
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_setbobdescription
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_findobject
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_findspace
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_walk
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_animation
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_return
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_object
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_plant
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_create_bob
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_removeobject
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_geologist
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_geologist_find
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_scout
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_playFX
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
void parse_construct
- (Worker_Descr *,
+ (WorkerDescr *,
Worker::Action *,
Parser *,
const std::vector<std::string> & cmd);
=== modified file 'src/logic/world/world.cc'
--- src/logic/world/world.cc 2014-07-05 14:22:44 +0000
+++ src/logic/world/world.cc 2014-07-28 18:15:26 +0000
@@ -30,7 +30,7 @@
#include "io/fileread.h"
#include "io/filesystem/layered_filesystem.h"
#include "io/filewrite.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/game_data_error.h"
#include "logic/immovable.h"
#include "logic/parse_map_object_types.h"
@@ -44,7 +44,7 @@
World::World()
: bobs_(new DescriptionMaintainer<BobDescr>()),
- immovables_(new DescriptionMaintainer<Immovable_Descr>()),
+ immovables_(new DescriptionMaintainer<ImmovableDescr>()),
terrains_(new DescriptionMaintainer<TerrainDescription>()),
resources_(new DescriptionMaintainer<ResourceDescription>()),
editor_terrain_categories_(new DescriptionMaintainer<EditorCategory>()),
@@ -67,15 +67,15 @@
}
void World::add_critter_type(const LuaTable& table) {
- bobs_->add(new Critter_Bob_Descr(table));
+ bobs_->add(new CritterDescr(table));
}
-const DescriptionMaintainer<Immovable_Descr>& World::immovables() const {
+const DescriptionMaintainer<ImmovableDescr>& World::immovables() const {
return *immovables_;
}
void World::add_immovable_type(const LuaTable& table) {
- immovables_->add(new Immovable_Descr(table, *this));
+ immovables_->add(new ImmovableDescr(table, *this));
}
void World::add_editor_terrain_category(const LuaTable& table) {
@@ -135,7 +135,7 @@
return immovables_->get_nitems();
}
-Immovable_Descr const* World::get_immovable_descr(int32_t const index) const {
+ImmovableDescr const* World::get_immovable_descr(int32_t const index) const {
return immovables_->get(index);
}
=== modified file 'src/logic/world/world.h'
--- src/logic/world/world.h 2014-07-14 19:24:12 +0000
+++ src/logic/world/world.h 2014-07-28 18:15:26 +0000
@@ -32,8 +32,8 @@
class Editor_Game_Base;
class ResourceDescription;
class TerrainDescription;
-struct Critter_Bob_Descr;
-struct Immovable_Descr;
+struct CritterDescr;
+struct ImmovableDescr;
/// This is the in memory descriptions of the world and provides access to
/// terrains, immovables and resources.
@@ -53,10 +53,10 @@
BobDescr const* get_bob_descr(const std::string& name) const;
int32_t get_nr_bobs() const;
- const DescriptionMaintainer<Immovable_Descr>& immovables() const;
+ const DescriptionMaintainer<ImmovableDescr>& immovables() const;
int32_t get_immovable_index(char const* const l) const;
int32_t get_nr_immovables() const;
- Immovable_Descr const* get_immovable_descr(int32_t index) const;
+ ImmovableDescr const* get_immovable_descr(int32_t index) const;
int32_t get_resource(const char* const name) const;
ResourceDescription const* get_resource(Resource_Index res) const;
@@ -85,7 +85,7 @@
private:
std::unique_ptr<DescriptionMaintainer<BobDescr>> bobs_;
- std::unique_ptr<DescriptionMaintainer<Immovable_Descr>> immovables_;
+ std::unique_ptr<DescriptionMaintainer<ImmovableDescr>> immovables_;
std::unique_ptr<DescriptionMaintainer<TerrainDescription>> terrains_;
std::unique_ptr<DescriptionMaintainer<ResourceDescription>> resources_;
std::unique_ptr<DescriptionMaintainer<EditorCategory>> editor_terrain_categories_;
=== modified file 'src/map_io/widelands_map_allowed_building_types_data_packet.cc'
--- src/map_io/widelands_map_allowed_building_types_data_packet.cc 2014-07-03 19:26:30 +0000
+++ src/map_io/widelands_map_allowed_building_types_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
return;
@@ -98,7 +98,7 @@
void Map_Allowed_Building_Types_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
prof.create_section("global").set_int
=== modified file 'src/map_io/widelands_map_allowed_worker_types_data_packet.cc'
--- src/map_io/widelands_map_allowed_worker_types_data_packet.cc 2014-07-03 19:26:30 +0000
+++ src/map_io/widelands_map_allowed_worker_types_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
return;
@@ -63,7 +63,7 @@
continue;
for (Ware_Index w = 0; w < tribe.get_nrworkers(); ++w) {
- const Worker_Descr & w_descr = *tribe.get_worker_descr(w);
+ const WorkerDescr & w_descr = *tribe.get_worker_descr(w);
if (w_descr.is_buildable())
player->allow_worker_type
(w, s->get_bool(w_descr.name().c_str(), true));
@@ -83,7 +83,7 @@
void Map_Allowed_Worker_Types_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
prof.create_section("global").set_int
=== modified file 'src/map_io/widelands_map_building_data_packet.cc'
--- src/map_io/widelands_map_building_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/map_io/widelands_map_building_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -46,7 +46,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -118,7 +118,7 @@
* Write Function
*/
void Map_Building_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_building_data_packet.h'
--- src/map_io/widelands_map_building_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_building_data_packet.h 2014-07-28 18:15:26 +0000
@@ -34,8 +34,8 @@
* on the map, the data is parsed somewhere else
*/
struct Map_Building_Data_Packet {
- void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&);
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&);
+ void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&);
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&);
protected:
void read_priorities (Building &, FileRead &);
=== modified file 'src/map_io/widelands_map_buildingdata_data_packet.cc'
--- src/map_io/widelands_map_buildingdata_data_packet.cc 2014-07-25 20:40:51 +0000
+++ src/map_io/widelands_map_buildingdata_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -70,7 +70,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -99,7 +99,7 @@
try {
building.m_anim =
building.descr().get_animation(animation_name);
- } catch (const Map_Object_Descr::Animation_Nonexistent &) {
+ } catch (const MapObjectDescr::Animation_Nonexistent &) {
log
("WARNING: %s %s does not have animation \"%s\"; "
"using animation \"idle\" instead\n",
@@ -145,7 +145,7 @@
if (uint32_t const leaver_serial = fr.Unsigned32())
try {
building.m_leave_allow =
- &mol.get<Map_Object>(leaver_serial);
+ &mol.get<MapObject>(leaver_serial);
} catch (const _wexception & e) {
throw game_data_error
("leave allow item (%u): %s", leaver_serial, e.what());
@@ -256,7 +256,7 @@
}
void Map_Buildingdata_Data_Packet::read_formerbuildings_v2
- (Building& b, FileRead&, Game&, Map_Map_Object_Loader&)
+ (Building& b, FileRead&, Game&, MapMapObjectLoader&)
{
const Tribe_Descr & t = b.descr().tribe();
Building_Index b_idx = t.building_index(b.descr().name());
@@ -280,12 +280,12 @@
// iterate through all buildings to find first predecessor
for (;;) {
Building_Index former_idx = b.m_old_buildings.front();
- const Building_Descr * oldest = t.get_building_descr(former_idx);
+ const BuildingDescr * oldest = t.get_building_descr(former_idx);
if (!oldest->is_enhanced()) {
break;
}
for (Building_Index i = 0; i < t.get_nrbuildings(); ++i) {
- Building_Descr const * ob = t.get_building_descr(i);
+ BuildingDescr const * ob = t.get_building_descr(i);
if (ob->enhancement() == former_idx) {
b.m_old_buildings.insert(b.m_old_buildings.begin(), i);
break;
@@ -299,7 +299,7 @@
(Partially_Finished_Building & pfb,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -360,7 +360,7 @@
(ConstructionSite & constructionsite,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -400,7 +400,7 @@
(ConstructionSite & constructionsite,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
const Tribe_Descr & tribe = constructionsite.descr().tribe();
constructionsite.m_building =
@@ -460,7 +460,7 @@
(DismantleSite & dms,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -481,7 +481,7 @@
(Warehouse & warehouse,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -750,7 +750,7 @@
(MilitarySite & militarysite,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -855,7 +855,7 @@
(ProductionSite & productionsite,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const packet_version = fr.Unsigned16();
@@ -865,7 +865,7 @@
{
ProductionSite::Working_Position & wp_begin =
*productionsite.m_working_positions;
- const ProductionSite_Descr & pr_descr = productionsite.descr();
+ const ProductionSiteDescr & pr_descr = productionsite.descr();
const BillOfMaterials & working_positions = pr_descr.working_positions();
uint16_t nr_worker_requests = fr.Unsigned16();
@@ -918,7 +918,7 @@
Worker * worker = &mol.get<Worker>(fr.Unsigned32());
// Find a working position that matches this worker.
- const Worker_Descr & worker_descr = worker->descr();
+ const WorkerDescr & worker_descr = worker->descr();
ProductionSite::Working_Position * wp = &wp_begin;
bool found_working_position = false;
for (const WareAmount& working_position : working_positions) {
@@ -994,7 +994,7 @@
if (packet_version >= 5) {
uint32_t serial = fr.Unsigned32();
if (serial)
- productionsite.m_stack[i].objvar = &mol.get<Map_Object>(serial);
+ productionsite.m_stack[i].objvar = &mol.get<MapObject>(serial);
productionsite.m_stack[i].coord = ReadCoords32_allow_null(&fr, game.map().extent());
}
}
@@ -1075,7 +1075,7 @@
(TrainingSite & trainingsite,
FileRead & fr,
Game & game,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
try {
uint16_t const trainingsite_packet_version = fr.Unsigned16();
@@ -1166,7 +1166,7 @@
void Map_Buildingdata_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
@@ -1207,7 +1207,7 @@
}
}
fw.Unsigned32(building->m_leave_time);
- if (Map_Object const * const o = building->m_leave_allow.get(egbase))
+ if (MapObject const * const o = building->m_leave_allow.get(egbase))
{
assert(mos.is_object_known(*o));
fw.Unsigned32(mos.get_object_file_index(*o));
@@ -1217,7 +1217,7 @@
{
const Tribe_Descr& td = building->descr().tribe();
for (Building_Index b_idx : building->m_old_buildings) {
- const Building_Descr* b_descr = td.get_building_descr(b_idx);
+ const BuildingDescr* b_descr = td.get_building_descr(b_idx);
fw.Unsigned8(1);
fw.String(b_descr->name());
}
@@ -1283,7 +1283,7 @@
(const Partially_Finished_Building & pfb,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_PARTIALLYFB_PACKET_VERSION);
@@ -1319,7 +1319,7 @@
(const ConstructionSite & constructionsite,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_CONSTRUCTIONSITE_PACKET_VERSION);
@@ -1333,7 +1333,7 @@
(const DismantleSite & dms,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_DISMANTLESITE_PACKET_VERSION);
@@ -1348,7 +1348,7 @@
(const Warehouse & warehouse,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_WAREHOUSE_PACKET_VERSION);
@@ -1441,7 +1441,7 @@
(const MilitarySite & militarysite,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_MILITARYSITE_PACKET_VERSION);
write_productionsite(militarysite, fw, game, mos);
@@ -1488,7 +1488,7 @@
(const ProductionSite & productionsite,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_PRODUCTIONSITE_PACKET_VERSION);
@@ -1566,7 +1566,7 @@
(const TrainingSite & trainingsite,
FileWrite & fw,
Game & game,
- Map_Map_Object_Saver & mos)
+ MapMapObjectSaver & mos)
{
fw.Unsigned16(CURRENT_TRAININGSITE_PACKET_VERSION);
=== modified file 'src/map_io/widelands_map_buildingdata_data_packet.h'
--- src/map_io/widelands_map_buildingdata_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_buildingdata_data_packet.h 2014-07-28 18:15:26 +0000
@@ -42,43 +42,43 @@
*/
class Map_Buildingdata_Data_Packet {
public:
- void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&);
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&);
+ void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&);
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&);
private:
void read_constructionsite
- (ConstructionSite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (ConstructionSite &, FileRead &, Game &, MapMapObjectLoader &);
void read_dismantlesite
- (DismantleSite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (DismantleSite &, FileRead &, Game &, MapMapObjectLoader &);
void read_partially_finished_building
- (Partially_Finished_Building &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (Partially_Finished_Building &, FileRead &, Game &, MapMapObjectLoader &);
void read_constructionsite_v1
- (ConstructionSite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (ConstructionSite &, FileRead &, Game &, MapMapObjectLoader &);
void read_warehouse
- (Warehouse &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (Warehouse &, FileRead &, Game &, MapMapObjectLoader &);
void read_militarysite
- (MilitarySite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (MilitarySite &, FileRead &, Game &, MapMapObjectLoader &);
void read_trainingsite
- (TrainingSite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (TrainingSite &, FileRead &, Game &, MapMapObjectLoader &);
void read_productionsite
- (ProductionSite &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (ProductionSite &, FileRead &, Game &, MapMapObjectLoader &);
void read_formerbuildings_v2
- (Building &, FileRead &, Game &, Map_Map_Object_Loader &);
+ (Building &, FileRead &, Game &, MapMapObjectLoader &);
void write_constructionsite
- (const ConstructionSite &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const ConstructionSite &, FileWrite &, Game &, MapMapObjectSaver &);
void write_dismantlesite
- (const DismantleSite &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const DismantleSite &, FileWrite &, Game &, MapMapObjectSaver &);
void write_partially_finished_building
- (const Partially_Finished_Building &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const Partially_Finished_Building &, FileWrite &, Game &, MapMapObjectSaver &);
void write_warehouse
- (const Warehouse &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const Warehouse &, FileWrite &, Game &, MapMapObjectSaver &);
void write_militarysite
- (const MilitarySite &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const MilitarySite &, FileWrite &, Game &, MapMapObjectSaver &);
void write_trainingsite
- (const TrainingSite &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const TrainingSite &, FileWrite &, Game &, MapMapObjectSaver &);
void write_productionsite
- (const ProductionSite &, FileWrite &, Game &, Map_Map_Object_Saver &);
+ (const ProductionSite &, FileWrite &, Game &, MapMapObjectSaver &);
};
}
=== modified file 'src/map_io/widelands_map_data_packet.h'
--- src/map_io/widelands_map_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_data_packet.h 2014-07-28 18:15:26 +0000
@@ -25,8 +25,8 @@
namespace Widelands {
class Editor_Game_Base;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
}
@@ -34,8 +34,8 @@
namespace Widelands { \
class name { \
public: \
- void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&); \
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&); \
+ void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&); \
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&); \
}; \
}
=== modified file 'src/map_io/widelands_map_elemental_data_packet.cc'
--- src/map_io/widelands_map_elemental_data_packet.cc 2014-07-11 18:03:25 +0000
+++ src/map_io/widelands_map_elemental_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -71,14 +71,14 @@
void Map_Elemental_Data_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, bool, Map_Map_Object_Loader &)
+ (FileSystem & fs, Editor_Game_Base & egbase, bool, MapMapObjectLoader &)
{
Pre_Read(fs, &egbase.map());
}
void Map_Elemental_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
=== modified file 'src/map_io/widelands_map_elemental_data_packet.h'
--- src/map_io/widelands_map_elemental_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_elemental_data_packet.h 2014-07-28 18:15:26 +0000
@@ -35,8 +35,8 @@
* like number of players, map size, world name, magic bytes and so on
*/
struct Map_Elemental_Data_Packet {
- void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&);
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&);
+ void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&);
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&);
/// The following function prereads a given map without the need of a
/// properly configured Editor_Game_Base object.
=== modified file 'src/map_io/widelands_map_exploration_data_packet.cc'
--- src/map_io/widelands_map_exploration_data_packet.cc 2014-07-05 14:22:44 +0000
+++ src/map_io/widelands_map_exploration_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -37,7 +37,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
return;
@@ -97,7 +97,7 @@
void Map_Exploration_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_flag_data_packet.cc'
--- src/map_io/widelands_map_flag_data_packet.cc 2014-07-03 19:26:30 +0000
+++ src/map_io/widelands_map_flag_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -42,7 +42,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -128,7 +128,7 @@
void Map_Flag_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_flagdata_data_packet.cc'
--- src/map_io/widelands_map_flagdata_data_packet.cc 2014-07-25 20:40:51 +0000
+++ src/map_io/widelands_map_flagdata_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -44,7 +44,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -226,7 +226,7 @@
void Map_Flagdata_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_heights_data_packet.cc'
--- src/map_io/widelands_map_heights_data_packet.cc 2014-05-11 07:53:49 +0000
+++ src/map_io/widelands_map_heights_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -32,7 +32,7 @@
void Map_Heights_Data_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, bool, Map_Map_Object_Loader &)
+ (FileSystem & fs, Editor_Game_Base & egbase, bool, MapMapObjectLoader &)
{
FileRead fr;
@@ -58,7 +58,7 @@
* Write Function
*/
void Map_Heights_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_loader.cc'
--- src/map_io/widelands_map_loader.cc 2014-07-17 16:05:41 +0000
+++ src/map_io/widelands_map_loader.cc 2014-07-28 18:15:26 +0000
@@ -110,7 +110,7 @@
preload_map(scenario);
m_map.set_size(m_map.m_width, m_map.m_height);
- m_mol.reset(new Map_Map_Object_Loader());
+ m_mol.reset(new MapMapObjectLoader());
// MANDATORY PACKETS
// PRELOAD DATA BEGIN
@@ -149,7 +149,7 @@
{Map_Terrain_Data_Packet p; p.Read(*m_fs, egbase, *lookup_table);}
log("took %ums\n ", timer.ms_since_last_query());
- Map_Object_Packet mapobjects;
+ MapObjectPacket mapobjects;
log("Reading Map Objects ... ");
mapobjects.Read(*m_fs, egbase, *m_mol, *lookup_table);
@@ -260,7 +260,7 @@
// Objectives
log("Reading Objective Data ... ");
- {Map_Objective_Data_Packet p; p.Read(*m_fs, egbase, !scenario, *m_mol);}
+ {MapObjectiveDataPacket p; p.Read(*m_fs, egbase, !scenario, *m_mol);}
log("took %ums\n ", timer.ms_since_last_query());
log("Reading Scripting Data ... ");
=== modified file 'src/map_io/widelands_map_loader.h'
--- src/map_io/widelands_map_loader.h 2014-07-26 10:43:23 +0000
+++ src/map_io/widelands_map_loader.h 2014-07-28 18:15:26 +0000
@@ -32,7 +32,7 @@
namespace Widelands {
class Editor_Game_Base;
-class Map_Map_Object_Loader;
+class MapMapObjectLoader;
/// Takes ownership of the filesystem that is passed to it.
struct WL_Map_Loader : public Map_Loader {
@@ -43,7 +43,7 @@
int32_t preload_map(bool) override;
int32_t load_map_complete(Editor_Game_Base &, bool) override;
- Map_Map_Object_Loader * get_map_object_loader() {return m_mol.get();}
+ MapMapObjectLoader * get_map_object_loader() {return m_mol.get();}
static bool is_widelands_map(const std::string & filename) {
return !strcasecmp(&filename.c_str()[filename.size() - 4], WLMF_SUFFIX);
@@ -57,7 +57,7 @@
private:
FileSystem* m_fs; // not owned (owned by Map).
std::string m_filename;
- std::unique_ptr<Map_Map_Object_Loader> m_mol;
+ std::unique_ptr<MapMapObjectLoader> m_mol;
std::string m_old_world_name;
};
=== modified file 'src/map_io/widelands_map_map_object_loader.cc'
--- src/map_io/widelands_map_map_object_loader.cc 2014-06-01 18:00:48 +0000
+++ src/map_io/widelands_map_map_object_loader.cc 2014-07-28 18:15:26 +0000
@@ -28,7 +28,7 @@
/*
* Returns true if this object has already been inserted
*/
-bool Map_Map_Object_Loader::is_object_known(Serial const n) {
+bool MapMapObjectLoader::is_object_known(Serial const n) {
return m_objects.find(n) != m_objects.end();
}
@@ -36,7 +36,7 @@
/*
* mark this object as saved
*/
-void Map_Map_Object_Loader::mark_object_as_loaded(Map_Object & obj)
+void MapMapObjectLoader::mark_object_as_loaded(MapObject & obj)
{
m_loaded_obj[&obj] = true;
}
@@ -44,13 +44,13 @@
/*
* Return the number of unsaved objects
*/
-int32_t Map_Map_Object_Loader::get_nr_unloaded_objects()
+int32_t MapMapObjectLoader::get_nr_unloaded_objects()
{
int32_t result = 0;
- std::map<Map_Object *, bool>::const_iterator const loaded_obj_end =
+ std::map<MapObject *, bool>::const_iterator const loaded_obj_end =
m_loaded_obj.end();
for
- (std::map<Map_Object *, bool>::const_iterator it = m_loaded_obj.begin();
+ (std::map<MapObject *, bool>::const_iterator it = m_loaded_obj.begin();
it != loaded_obj_end;
++it)
if (!it->second)
@@ -63,7 +63,7 @@
*
* \note Only use this for compatibility hacks!
*/
-void Map_Map_Object_Loader::schedule_destroy(Map_Object & obj)
+void MapMapObjectLoader::schedule_destroy(MapObject & obj)
{
m_schedule_destroy.push_back(&obj);
}
@@ -74,7 +74,7 @@
*
* \note Only use this for compatibility hacks!
*/
-void Map_Map_Object_Loader::schedule_act(Bob & bob)
+void MapMapObjectLoader::schedule_act(Bob & bob)
{
m_schedule_act.push_back(&bob);
}
@@ -84,7 +84,7 @@
*
* \note Only use this for compatibility hacks!
*/
-void Map_Map_Object_Loader::load_finish_game(Game & g)
+void MapMapObjectLoader::load_finish_game(Game & g)
{
while (!m_schedule_destroy.empty()) {
m_schedule_destroy.back()->schedule_destroy(g);
=== modified file 'src/map_io/widelands_map_map_object_loader.h'
--- src/map_io/widelands_map_map_object_loader.h 2014-07-26 09:48:21 +0000
+++ src/map_io/widelands_map_map_object_loader.h 2014-07-28 18:15:26 +0000
@@ -33,15 +33,15 @@
namespace Widelands {
class Bob;
-class Map_Object;
+class MapObject;
class Editor_Game_Base;
/*
* This class helps to
* - keep track of map objects on the map (to be loaded)
- * - translate file index pointers into Map_Objects
+ * - translate file index pointers into MapObjects
*/
-class Map_Map_Object_Loader {
+class MapMapObjectLoader {
public:
bool is_object_known(uint32_t);
@@ -59,19 +59,19 @@
// never even be allocated then. But this change can only be done when all
// kinds of map objects have suitable default constructors.
template<typename T> T & register_object(Serial const n, T & object) {
- Reverse_Map_Object_Map::const_iterator const existing =
+ ReverseMapObjectMap::const_iterator const existing =
m_objects.find(n);
if (existing != m_objects.end()) {
//delete &object; can not do this
throw game_data_error("already loaded (%s)", to_string(existing->second->descr().type()).c_str());
}
- m_objects.insert(std::pair<Serial, Map_Object *>(n, &object));
+ m_objects.insert(std::pair<Serial, MapObject *>(n, &object));
m_loaded_obj[&object] = false;
return object;
}
template<typename T> T & get(Serial const serial) {
- Reverse_Map_Object_Map::iterator const it = m_objects.find(serial);
+ ReverseMapObjectMap::iterator const it = m_objects.find(serial);
if (it == m_objects.end())
throw game_data_error("not found");
else if (upcast(T, result, it->second))
@@ -83,22 +83,22 @@
}
int32_t get_nr_unloaded_objects();
- bool is_object_loaded(Map_Object & obj) {return m_loaded_obj[&obj];}
-
- void mark_object_as_loaded(Map_Object &);
-
- void schedule_destroy(Map_Object &);
+ bool is_object_loaded(MapObject & obj) {return m_loaded_obj[&obj];}
+
+ void mark_object_as_loaded(MapObject &);
+
+ void schedule_destroy(MapObject &);
void schedule_act(Bob &);
void load_finish_game(Game & g);
private:
- typedef std::map<Serial, Map_Object *> Reverse_Map_Object_Map;
-
- std::map<Map_Object *, bool> m_loaded_obj;
- Reverse_Map_Object_Map m_objects;
-
- std::vector<Map_Object *> m_schedule_destroy;
+ typedef std::map<Serial, MapObject *> ReverseMapObjectMap;
+
+ std::map<MapObject *, bool> m_loaded_obj;
+ ReverseMapObjectMap m_objects;
+
+ std::vector<MapObject *> m_schedule_destroy;
std::vector<Bob *> m_schedule_act;
};
=== modified file 'src/map_io/widelands_map_map_object_saver.cc'
--- src/map_io/widelands_map_map_object_saver.cc 2014-07-26 09:48:21 +0000
+++ src/map_io/widelands_map_map_object_saver.cc 2014-07-28 18:15:26 +0000
@@ -33,7 +33,7 @@
namespace Widelands {
-Map_Map_Object_Saver::Map_Map_Object_Saver() :
+MapMapObjectSaver::MapMapObjectSaver() :
m_nr_roads (0),
m_nr_flags (0),
m_nr_buildings (0),
@@ -51,10 +51,10 @@
* Return a pointer to the record for the given object.
* Create a record if that hasn't been done yet.
*/
-Map_Map_Object_Saver::MapObjectRec &
-Map_Map_Object_Saver::get_object_record(const Map_Object & obj)
+MapMapObjectSaver::MapObjectRec &
+MapMapObjectSaver::get_object_record(const MapObject & obj)
{
- Map_Object_Map::iterator it = m_objects.find(&obj);
+ MapObjectMap::iterator it = m_objects.find(&obj);
if (it != m_objects.end())
return it->second;
@@ -70,7 +70,7 @@
rec.registered = false;
rec.saved = false;
return
- m_objects.insert(std::pair<Map_Object const *, MapObjectRec>(&obj, rec))
+ m_objects.insert(std::pair<MapObject const *, MapObjectRec>(&obj, rec))
.first->second;
}
@@ -79,9 +79,9 @@
* Returns true if this object has already been registered.
* \deprecated since get_object_file_index supports unregistered objects now
*/
-bool Map_Map_Object_Saver::is_object_known(const Map_Object & obj) const
+bool MapMapObjectSaver::is_object_known(const MapObject & obj) const
{
- Map_Object_Map::const_iterator it = m_objects.find(&obj);
+ MapObjectMap::const_iterator it = m_objects.find(&obj);
if (it == m_objects.end())
return false;
@@ -89,7 +89,7 @@
return it->second.registered;
}
-bool Map_Map_Object_Saver::is_object_saved(const Map_Object & obj)
+bool MapMapObjectSaver::is_object_saved(const MapObject & obj)
{
return get_object_record(obj).saved;
}
@@ -98,7 +98,7 @@
/*
* Registers this object as a new one
*/
-Serial Map_Map_Object_Saver::register_object(const Map_Object & obj) {
+Serial MapMapObjectSaver::register_object(const MapObject & obj) {
MapObjectRec & rec = get_object_record(obj);
assert(!rec.registered);
@@ -113,7 +113,7 @@
else if (dynamic_cast<Fleet const *>(&obj)) ++m_nr_fleets;
else if (dynamic_cast<PortDock const *>(&obj)) ++m_nr_portdocks;
else
- throw wexception("Map_Map_Object_Saver: Unknown MapObject type");
+ throw wexception("MapMapObjectSaver: Unknown MapObject type");
rec.registered = true;
return rec.fileserial;
@@ -123,7 +123,7 @@
* Returns the file index for this map object. This is used on load
* to regenerate the dependencies between the objects.
*/
-uint32_t Map_Map_Object_Saver::get_object_file_index(const Map_Object & obj)
+uint32_t MapMapObjectSaver::get_object_file_index(const MapObject & obj)
{
return get_object_record(obj).fileserial;
}
@@ -131,8 +131,8 @@
/**
* Returns the file index of the given object, or zero for null pointers.
*/
-uint32_t Map_Map_Object_Saver::get_object_file_index_or_zero
- (const Map_Object * obj)
+uint32_t MapMapObjectSaver::get_object_file_index_or_zero
+ (const MapObject * obj)
{
if (obj)
return get_object_file_index(*obj);
@@ -142,7 +142,7 @@
/*
* mark this object as saved
*/
-void Map_Map_Object_Saver::mark_object_as_saved(const Map_Object & obj) {
+void MapMapObjectSaver::mark_object_as_saved(const MapObject & obj) {
MapObjectRec & rec = get_object_record(obj);
assert(rec.registered);
rec.saved = true;
@@ -152,8 +152,8 @@
/*
* Return the number of unsaved objects
*/
-void Map_Map_Object_Saver::detect_unsaved_objects() const {
- for (const std::pair<const Map_Object *, MapObjectRec>& temp_map : m_objects) {
+void MapMapObjectSaver::detect_unsaved_objects() const {
+ for (const std::pair<const MapObject *, MapObjectRec>& temp_map : m_objects) {
if (!temp_map.second.saved) {
throw wexception
("%s has not been saved", temp_map.second.description.c_str());
=== modified file 'src/map_io/widelands_map_map_object_saver.h'
--- src/map_io/widelands_map_map_object_saver.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_map_object_saver.h 2014-07-28 18:15:26 +0000
@@ -29,23 +29,23 @@
namespace Widelands {
-class Map_Object;
+class MapObject;
/*
* This class helps to
* - keep track of map objects on the map
- * - translate Map_Object* Pointer into the index used in the saved file
+ * - translate MapObject* Pointer into the index used in the saved file
*/
-struct Map_Map_Object_Saver {
- Map_Map_Object_Saver();
-
- bool is_object_known(const Map_Object &) const;
- Serial register_object(const Map_Object &);
-
- uint32_t get_object_file_index(const Map_Object &);
- uint32_t get_object_file_index_or_zero(Map_Object const *);
-
- void mark_object_as_saved(const Map_Object &);
+struct MapMapObjectSaver {
+ MapMapObjectSaver();
+
+ bool is_object_known(const MapObject &) const;
+ Serial register_object(const MapObject &);
+
+ uint32_t get_object_file_index(const MapObject &);
+ uint32_t get_object_file_index_or_zero(MapObject const *);
+
+ void mark_object_as_saved(const MapObject &);
// Information functions
#ifndef NDEBUG
@@ -59,7 +59,7 @@
uint32_t get_nr_immovables () const {return m_nr_immovables;}
uint32_t get_nr_battles () const {return m_nr_battles;}
- bool is_object_saved(const Map_Object &);
+ bool is_object_saved(const MapObject &);
/// \note Indexed by player number - 1.
Map_Message_Saver message_savers[MAX_PLAYERS];
@@ -73,11 +73,11 @@
bool registered;
bool saved;
};
- typedef std::map<const Map_Object *, MapObjectRec> Map_Object_Map;
-
- MapObjectRec & get_object_record(const Map_Object &);
-
- Map_Object_Map m_objects;
+ typedef std::map<const MapObject *, MapObjectRec> MapObjectMap;
+
+ MapObjectRec & get_object_record(const MapObject &);
+
+ MapObjectMap m_objects;
uint32_t m_nr_roads;
uint32_t m_nr_flags;
uint32_t m_nr_buildings;
=== modified file 'src/map_io/widelands_map_node_ownership_data_packet.cc'
--- src/map_io/widelands_map_node_ownership_data_packet.cc 2014-05-11 07:53:49 +0000
+++ src/map_io/widelands_map_node_ownership_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -35,7 +35,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
@@ -67,7 +67,7 @@
void Map_Node_Ownership_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_object_packet.cc'
--- src/map_io/widelands_map_object_packet.cc 2014-07-26 09:48:21 +0000
+++ src/map_io/widelands_map_object_packet.cc 2014-07-28 18:15:26 +0000
@@ -25,7 +25,7 @@
#include "io/fileread.h"
#include "io/filewrite.h"
#include "logic/battle.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/editor_game_base.h"
#include "logic/immovable.h"
#include "logic/map.h"
@@ -39,7 +39,7 @@
#define CURRENT_PACKET_VERSION 1
-Map_Object_Packet::~Map_Object_Packet() {
+MapObjectPacket::~MapObjectPacket() {
while (loaders.size()) {
delete *loaders.begin();
loaders.erase(loaders.begin());
@@ -47,8 +47,8 @@
}
-void Map_Object_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Loader & mol,
+void MapObjectPacket::Read
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectLoader & mol,
const OneWorldLegacyLookupTable& lookup_table)
{
try {
@@ -65,35 +65,35 @@
switch (uint8_t const header = fr.Unsigned8()) {
case 0:
return;
- case Map_Object::header_Immovable:
+ case MapObject::HeaderImmovable:
loaders.insert(Immovable::load(egbase, mol, fr, lookup_table));
break;
- case Map_Object::header_Battle:
+ case MapObject::HeaderBattle:
loaders.insert(Battle::load(egbase, mol, fr));
break;
- case Map_Object::header_Critter:
- loaders.insert(Critter_Bob::load(egbase, mol, fr, lookup_table));
+ case MapObject::HeaderCritter:
+ loaders.insert(Critter::load(egbase, mol, fr, lookup_table));
break;
- case Map_Object::header_Worker:
+ case MapObject::HeaderWorker:
loaders.insert(Worker::load(egbase, mol, fr));
break;
- case Map_Object::header_WareInstance:
+ case MapObject::HeaderWareInstance:
loaders.insert(WareInstance::load(egbase, mol, fr));
break;
- case Map_Object::header_Ship:
+ case MapObject::HeaderShip:
loaders.insert(Ship::load(egbase, mol, fr));
break;
- case Map_Object::header_PortDock:
+ case MapObject::HeaderPortDock:
loaders.insert(PortDock::load(egbase, mol, fr));
break;
- case Map_Object::header_Fleet:
+ case MapObject::HeaderFleet:
loaders.insert(Fleet::load(egbase, mol, fr));
break;
@@ -106,9 +106,9 @@
}
-void Map_Object_Packet::LoadFinish() {
+void MapObjectPacket::LoadFinish() {
// load_pointer stage
- for (Map_Object::Loader* temp_loader : loaders) {
+ for (MapObject::Loader* temp_loader : loaders) {
try {
temp_loader->load_pointers();
} catch (const std::exception & e) {
@@ -119,7 +119,7 @@
}
// load_finish stage
- for (Map_Object::Loader* temp_loader : loaders) {
+ for (MapObject::Loader* temp_loader : loaders) {
try {
temp_loader->load_finish();
} catch (const std::exception & e) {
@@ -132,8 +132,8 @@
}
-void Map_Object_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+void MapObjectPacket::Write
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
@@ -145,12 +145,12 @@
cit != obj_serials.end();
++cit)
{
- Map_Object * pobj = egbase.objects().get_object(*cit);
+ MapObject * pobj = egbase.objects().get_object(*cit);
assert(pobj);
- Map_Object & obj = *pobj;
+ MapObject & obj = *pobj;
// These checks can be eliminated and the object saver simplified
- // once all Map_Objects are saved using the new system
+ // once all MapObjects are saved using the new system
if (mos.is_object_known(obj))
continue;
=== modified file 'src/map_io/widelands_map_object_packet.h'
--- src/map_io/widelands_map_object_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_object_packet.h 2014-07-28 18:15:26 +0000
@@ -30,37 +30,37 @@
namespace Widelands {
class Editor_Game_Base;
-class Map_Map_Object_Loader;
-struct Map_Map_Object_Saver;
+class MapMapObjectLoader;
+struct MapMapObjectSaver;
/**
- * This data packet contains all \ref Map_Object and derived instances.
+ * This data packet contains all \ref MapObject and derived instances.
*
- * \note Right now, only those Map_Objects not covered by other objects
+ * \note Right now, only those MapObjects not covered by other objects
* are in this packet.
*/
-struct Map_Object_Packet {
+struct MapObjectPacket {
struct loader_sorter {
bool operator()
- (Map_Object::Loader * const a, Map_Object::Loader * const b) const
+ (MapObject::Loader * const a, MapObject::Loader * const b) const
{
assert(a->get_object()->serial() != b->get_object()->serial());
return a->get_object()->serial() < b->get_object()->serial();
}
};
- typedef std::set<Map_Object::Loader *, loader_sorter> LoaderSet;
+ typedef std::set<MapObject::Loader *, loader_sorter> LoaderSet;
LoaderSet loaders;
- ~Map_Object_Packet();
+ ~MapObjectPacket();
void Read
- (FileSystem &, Editor_Game_Base &, Map_Map_Object_Loader &,
+ (FileSystem &, Editor_Game_Base &, MapMapObjectLoader &,
const OneWorldLegacyLookupTable& lookup_table);
void LoadFinish();
- void Write(FileSystem &, Editor_Game_Base &, Map_Map_Object_Saver &);
+ void Write(FileSystem &, Editor_Game_Base &, MapMapObjectSaver &);
};
}
=== modified file 'src/map_io/widelands_map_objective_data_packet.cc'
--- src/map_io/widelands_map_objective_data_packet.cc 2014-06-21 10:24:12 +0000
+++ src/map_io/widelands_map_objective_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -32,11 +32,11 @@
#define CURRENT_PACKET_VERSION 2
-void Map_Objective_Data_Packet::Read
+void MapObjectiveDataPacket::Read
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
return;
@@ -73,8 +73,8 @@
}
-void Map_Objective_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+void MapObjectiveDataPacket::Write
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
prof.create_section("global").set_int
=== modified file 'src/map_io/widelands_map_objective_data_packet.h'
--- src/map_io/widelands_map_objective_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_objective_data_packet.h 2014-07-28 18:15:26 +0000
@@ -22,6 +22,6 @@
#include "map_io/widelands_map_data_packet.h"
-MAP_DATA_PACKET(Map_Objective_Data_Packet)
+MAP_DATA_PACKET(MapObjectiveDataPacket)
#endif // end of include guard: WL_MAP_IO_WIDELANDS_MAP_OBJECTIVE_DATA_PACKET_H
=== modified file 'src/map_io/widelands_map_player_names_and_tribes_data_packet.cc'
--- src/map_io/widelands_map_player_names_and_tribes_data_packet.cc 2014-03-05 20:18:37 +0000
+++ src/map_io/widelands_map_player_names_and_tribes_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -44,7 +44,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
Pre_Read(fs, egbase.get_map(), skip);
}
@@ -83,7 +83,7 @@
void Map_Player_Names_And_Tribes_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
=== modified file 'src/map_io/widelands_map_player_names_and_tribes_data_packet.h'
--- src/map_io/widelands_map_player_names_and_tribes_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_player_names_and_tribes_data_packet.h 2014-07-28 18:15:26 +0000
@@ -33,8 +33,8 @@
struct Map_Player_Names_And_Tribes_Data_Packet {
virtual ~Map_Player_Names_And_Tribes_Data_Packet();
- virtual void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&);
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&);
+ virtual void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&);
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&);
void Pre_Read(FileSystem &, Map *, bool skip);
};
=== modified file 'src/map_io/widelands_map_player_position_data_packet.cc'
--- src/map_io/widelands_map_player_position_data_packet.cc 2014-06-09 08:23:57 +0000
+++ src/map_io/widelands_map_player_position_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -31,7 +31,7 @@
void Map_Player_Position_Data_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, bool, Map_Map_Object_Loader &)
+ (FileSystem & fs, Editor_Game_Base & egbase, bool, MapMapObjectLoader &)
{
Profile prof;
prof.read("player_position", nullptr, fs);
@@ -65,7 +65,7 @@
void Map_Player_Position_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
Section & s = prof.create_section("global");
=== modified file 'src/map_io/widelands_map_players_messages_data_packet.cc'
--- src/map_io/widelands_map_players_messages_data_packet.cc 2014-07-25 20:40:51 +0000
+++ src/map_io/widelands_map_players_messages_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
#define FILENAME_SIZE 19
void Map_Players_Messages_Data_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, bool, Map_Map_Object_Loader & mol)
+ (FileSystem & fs, Editor_Game_Base & egbase, bool, MapMapObjectLoader & mol)
{
uint32_t const gametime = egbase.get_gametime ();
@@ -138,7 +138,7 @@
Serial serial = s->get_int("serial", 0);
if (serial > 0) {
assert(mol.is_object_known(serial));
- Map_Object & mo = mol.get<Map_Object>(serial);
+ MapObject & mo = mol.get<MapObject>(serial);
assert(mol.is_object_loaded(mo));
serial = mo.serial();
}
@@ -169,7 +169,7 @@
}
void Map_Players_Messages_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fs.EnsureDirectoryExists("player");
Player_Number const nr_players = egbase.map().get_nrplayers();
@@ -237,7 +237,7 @@
assert(false);
}
if (message.serial()) {
- const Map_Object* mo = egbase.objects().get_object(message.serial());
+ const MapObject* mo = egbase.objects().get_object(message.serial());
uint32_t fileindex = mos.get_object_file_index_or_zero(mo);
s.set_int ("serial", fileindex);
}
=== modified file 'src/map_io/widelands_map_players_view_data_packet.cc'
--- src/map_io/widelands_map_players_view_data_packet.cc 2014-07-26 10:15:48 +0000
+++ src/map_io/widelands_map_players_view_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -102,9 +102,9 @@
// / \ /
// bl------br
-struct Map_Object_Data {
- Map_Object_Data() : map_object_descr(nullptr) {}
- const Map_Object_Descr * map_object_descr;
+struct MapObjectData {
+ MapObjectData() : map_object_descr(nullptr) {}
+ const MapObjectDescr * map_object_descr;
Player::Constructionsite_Information csi;
};
@@ -234,7 +234,7 @@
//
// \throws Immovable_Nonexistent if there is no imovable type with that
// name in the tribe.
-const Immovable_Descr& ReadImmovable_Type(StreamRead* fr, const Tribe_Descr& tribe) {
+const ImmovableDescr& ReadImmovable_Type(StreamRead* fr, const Tribe_Descr& tribe) {
std::string name = fr->CString();
int32_t const index = tribe.get_immovable_index(name);
if (index == -1)
@@ -279,7 +279,7 @@
//
// \throws Immovable_Nonexistent if there is no imovable type with that
// name in the World.
-const Immovable_Descr& ReadImmovable_Type(StreamRead* fr, const World& world) {
+const ImmovableDescr& ReadImmovable_Type(StreamRead* fr, const World& world) {
char const* const name = fr->CString();
int32_t const index = world.get_immovable_index(name);
if (index == -1)
@@ -291,7 +291,7 @@
// Immovable_Type(const Tribe_Descr &) is called with that tribe and the
// result is returned. Otherwise Immovable_Type(const World &) is called
// and the result is returned.
-const Immovable_Descr& ReadImmovable_Type(StreamRead* fr, const Editor_Game_Base& egbase) {
+const ImmovableDescr& ReadImmovable_Type(StreamRead* fr, const Editor_Game_Base& egbase) {
if (Tribe_Descr const* const tribe = ReadTribe_allow_null(fr, egbase))
return ReadImmovable_Type(fr, *tribe);
else
@@ -303,7 +303,7 @@
// \returns a reference to the building type description.
//
// \throws Building_Nonexistent if there is no building type with that
-const Building_Descr& ReadBuilding_Type(StreamRead* fr, const Tribe_Descr& tribe) {
+const BuildingDescr& ReadBuilding_Type(StreamRead* fr, const Tribe_Descr& tribe) {
char const* const name = fr->CString();
Building_Index const index = tribe.building_index(name);
if (index == INVALID_INDEX)
@@ -315,7 +315,7 @@
// CString and interprets it as the name of a building type in that tribe.
//
// \returns a reference to the building type description.
-const Building_Descr& ReadBuilding_Type(StreamRead* fr, const Editor_Game_Base& egbase) {
+const BuildingDescr& ReadBuilding_Type(StreamRead* fr, const Editor_Game_Base& egbase) {
return ReadBuilding_Type(fr, ReadTribe(fr, egbase));
}
@@ -330,27 +330,27 @@
}
// Encode a Immovable_Type into 'wr'.
-void WriteImmovable_Type(StreamWrite* wr, const Immovable_Descr& immovable) {
+void WriteImmovable_Type(StreamWrite* wr, const ImmovableDescr& immovable) {
WriteTribe(wr, immovable.get_owner_tribe());
wr->String(immovable.name());
}
// Encode a Building_Type into 'wr'.
-void WriteBuilding_Type(StreamWrite* wr, const Building_Descr& building) {
+void WriteBuilding_Type(StreamWrite* wr, const BuildingDescr& building) {
WriteTribe(wr, building.tribe());
wr->String(building.name());
}
} // namespace
-inline static Map_Object_Data read_unseen_immovable
+inline static MapObjectData read_unseen_immovable
(const Editor_Game_Base & egbase,
uint8_t & immovable_kind,
FileRead & immovables_file,
uint8_t & version
)
{
- Map_Object_Data m;
+ MapObjectData m;
try {
switch (immovable_kind) {
case 0: // The player sees no immovable.
@@ -389,7 +389,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
@@ -451,7 +451,7 @@
assert(f_player_field.owner < 0x20);
// map_object_descr
- const Map_Object_Descr * map_object_descr;
+ const MapObjectDescr * map_object_descr;
if (const BaseImmovable * base_immovable = f.field->get_immovable()) {
map_object_descr = &base_immovable->descr();
if (Road::IsRoadDescr(map_object_descr))
@@ -693,7 +693,7 @@
} else {
imm_kind = node_immovable_kinds_file.Unsigned8();
}
- Map_Object_Data mod =
+ MapObjectData mod =
read_unseen_immovable
(egbase, imm_kind, node_immovables_file, node_immovables_file_version);
f_player_field.map_object_descr[TCoords<>::None] = mod.map_object_descr;
@@ -728,7 +728,7 @@
assert(owner <= nr_players);
// map_object_descr
- const Map_Object_Descr * map_object_descr;
+ const MapObjectDescr * map_object_descr;
if (const BaseImmovable * base_immovable = f.field->get_immovable()) {
map_object_descr = &base_immovable->descr();
if (Road::IsRoadDescr(map_object_descr))
@@ -772,7 +772,7 @@
} else {
im_kind = triangle_immovable_kinds_file.Unsigned8();
}
- Map_Object_Data mod =
+ MapObjectData mod =
read_unseen_immovable
(egbase, im_kind, triangle_immovables_file, triangle_immovables_file_version);
f_player_field.map_object_descr[TCoords<>::D] = mod.map_object_descr;
@@ -805,7 +805,7 @@
} else {
im_kind = triangle_immovable_kinds_file.Unsigned8();
}
- Map_Object_Data mod =
+ MapObjectData mod =
read_unseen_immovable
(egbase, im_kind, triangle_immovables_file, triangle_immovables_file_version);
f_player_field.map_object_descr[TCoords<>::R] = mod.map_object_descr;
@@ -986,22 +986,22 @@
inline static void write_unseen_immovable
- (Map_Object_Data const * map_object_data,
+ (MapObjectData const * map_object_data,
FileWrite & immovable_kinds_file, FileWrite & immovables_file)
{
- Map_Object_Descr const * const map_object_descr = map_object_data->map_object_descr;
+ MapObjectDescr const * const map_object_descr = map_object_data->map_object_descr;
const Player::Constructionsite_Information & csi = map_object_data->csi;
assert(!Road::IsRoadDescr(map_object_descr));
uint8_t immovable_kind = 255;
if (!map_object_descr)
immovable_kind = 0;
- else if (upcast(Immovable_Descr const, immovable_descr, map_object_descr)) {
+ else if (upcast(ImmovableDescr const, immovable_descr, map_object_descr)) {
immovable_kind = 1;
WriteImmovable_Type(&immovables_file, *immovable_descr);
- } else if (map_object_descr->type() == Map_Object_Type::FLAG)
+ } else if (map_object_descr->type() == MapObjectType::FLAG)
immovable_kind = 2;
- else if (upcast(Building_Descr const, building_descr, map_object_descr)) {
+ else if (upcast(BuildingDescr const, building_descr, map_object_descr)) {
immovable_kind = 3;
WriteBuilding_Type(&immovables_file, *building_descr);
if (!csi.becomes)
@@ -1020,7 +1020,7 @@
immovables_file.Unsigned32(csi.totaltime);
immovables_file.Unsigned32(csi.completedtime);
}
- } else if (map_object_descr->type() == Map_Object_Type::PORTDOCK)
+ } else if (map_object_descr->type() == MapObjectType::PORTDOCK)
immovable_kind = 4;
else
{
@@ -1041,7 +1041,7 @@
(file).Write(fs, filename); \
void Map_Players_View_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
fs.EnsureDirectoryExists("player");
const Map & map = egbase.map();
@@ -1101,7 +1101,7 @@
(f_player_field.time_node_last_unseen);
assert(f_player_field.owner < 0x20);
owners_file.Unsigned8(f_player_field.owner);
- Map_Object_Data mod;
+ MapObjectData mod;
mod.map_object_descr = f_player_field.map_object_descr[TCoords<>::None];
mod.csi = f_player_field.constructionsite;
write_unseen_immovable(&mod, node_immovable_kinds_file, node_immovables_file);
@@ -1123,7 +1123,7 @@
(f_everseen | bl_everseen | br_everseen))
{
terrains_file.Unsigned8(f_player_field.terrains.d);
- Map_Object_Data mod;
+ MapObjectData mod;
mod.map_object_descr = f_player_field.map_object_descr[TCoords<>::D];
write_unseen_immovable(&mod, triangle_immovable_kinds_file, triangle_immovables_file);
}
@@ -1134,7 +1134,7 @@
(f_everseen | br_everseen | r_everseen))
{
terrains_file.Unsigned8(f_player_field.terrains.r);
- Map_Object_Data mod;
+ MapObjectData mod;
mod.map_object_descr = f_player_field.map_object_descr[TCoords<>::R];
write_unseen_immovable(&mod, triangle_immovable_kinds_file, triangle_immovables_file);
}
=== modified file 'src/map_io/widelands_map_port_spaces_data_packet.cc'
--- src/map_io/widelands_map_port_spaces_data_packet.cc 2014-07-05 12:17:03 +0000
+++ src/map_io/widelands_map_port_spaces_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -34,7 +34,7 @@
#define CURRENT_PACKET_VERSION 1
void Map_Port_Spaces_Data_Packet::Read
- (FileSystem & fs, Editor_Game_Base & egbase, bool, Map_Map_Object_Loader &)
+ (FileSystem & fs, Editor_Game_Base & egbase, bool, MapMapObjectLoader &)
{
Profile prof;
prof.read("port_spaces", nullptr, fs);
@@ -65,7 +65,7 @@
}
-void Map_Port_Spaces_Data_Packet::Write(FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+void Map_Port_Spaces_Data_Packet::Write(FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
=== modified file 'src/map_io/widelands_map_port_spaces_data_packet.h'
--- src/map_io/widelands_map_port_spaces_data_packet.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_port_spaces_data_packet.h 2014-07-28 18:15:26 +0000
@@ -30,8 +30,8 @@
/// The port data packet contains all port build spaces
struct Map_Port_Spaces_Data_Packet {
- void Read(FileSystem&, Editor_Game_Base&, bool, Map_Map_Object_Loader&);
- void Write(FileSystem&, Editor_Game_Base&, Map_Map_Object_Saver&);
+ void Read(FileSystem&, Editor_Game_Base&, bool, MapMapObjectLoader&);
+ void Write(FileSystem&, Editor_Game_Base&, MapMapObjectSaver&);
// The following function prereads a given map without the need of a
// properly configured Editor_Game_Base object.
=== modified file 'src/map_io/widelands_map_road_data_packet.cc'
--- src/map_io/widelands_map_road_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/map_io/widelands_map_road_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -40,7 +40,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -71,7 +71,7 @@
void Map_Road_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_roaddata_data_packet.cc'
--- src/map_io/widelands_map_roaddata_data_packet.cc 2014-07-25 22:17:48 +0000
+++ src/map_io/widelands_map_roaddata_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -45,7 +45,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
if (skip)
return;
@@ -216,7 +216,7 @@
void Map_Roaddata_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
FileWrite fw;
=== modified file 'src/map_io/widelands_map_saver.cc'
--- src/map_io/widelands_map_saver.cc 2014-07-20 07:44:22 +0000
+++ src/map_io/widelands_map_saver.cc 2014-07-28 18:15:26 +0000
@@ -67,7 +67,7 @@
ScopedTimer timer("Map_Saver::save() took %ums");
delete m_mos;
- m_mos = new Map_Map_Object_Saver();
+ m_mos = new MapMapObjectSaver();
// The binary data is saved in an own directory
// to keep it hidden from the poor debuggers
@@ -162,7 +162,7 @@
log("took %ums\n ", timer.ms_since_last_query());
log("Writing Map Objects ... ");
- {Map_Object_Packet p; p.Write(m_fs, m_egbase, *m_mos);}
+ {MapObjectPacket p; p.Write(m_fs, m_egbase, *m_mos);}
log("took %ums\n ", timer.ms_since_last_query());
// DATA PACKETS
@@ -201,7 +201,7 @@
log("took %ums\n ", timer.ms_since_last_query());
log("Writing Objective Data ... ");
- {Map_Objective_Data_Packet p; p.Write(m_fs, m_egbase, *m_mos);}
+ {MapObjectiveDataPacket p; p.Write(m_fs, m_egbase, *m_mos);}
log("took %ums\n ", timer.ms_since_last_query());
#ifndef NDEBUG
=== modified file 'src/map_io/widelands_map_saver.h'
--- src/map_io/widelands_map_saver.h 2014-07-05 16:41:51 +0000
+++ src/map_io/widelands_map_saver.h 2014-07-28 18:15:26 +0000
@@ -27,7 +27,7 @@
namespace Widelands {
class Editor_Game_Base;
-struct Map_Map_Object_Saver;
+struct MapMapObjectSaver;
/*
===========================
@@ -46,12 +46,12 @@
~Map_Saver();
void save();
- Map_Map_Object_Saver * get_map_object_saver() {return m_mos;}
+ MapMapObjectSaver * get_map_object_saver() {return m_mos;}
private:
Editor_Game_Base & m_egbase;
FileSystem & m_fs;
- Map_Map_Object_Saver * m_mos;
+ MapMapObjectSaver * m_mos;
};
}
=== modified file 'src/map_io/widelands_map_scripting_data_packet.cc'
--- src/map_io/widelands_map_scripting_data_packet.cc 2014-07-20 07:44:22 +0000
+++ src/map_io/widelands_map_scripting_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -49,7 +49,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool,
- Map_Map_Object_Loader & mol)
+ MapMapObjectLoader & mol)
{
// Always try to load the global State: even in a normal game, some lua
// coroutines could run. But make sure that this is really a game, other
@@ -71,7 +71,7 @@
void Map_Scripting_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver & mos)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver & mos)
{
fs.EnsureDirectoryExists("scripting");
=== modified file 'src/map_io/widelands_map_version_data_packet.cc'
--- src/map_io/widelands_map_version_data_packet.cc 2014-07-25 11:14:03 +0000
+++ src/map_io/widelands_map_version_data_packet.cc 2014-07-28 18:15:26 +0000
@@ -36,7 +36,7 @@
(FileSystem & fs,
Editor_Game_Base & egbase,
bool const skip,
- Map_Map_Object_Loader &)
+ MapMapObjectLoader &)
{
if (skip)
return;
@@ -78,7 +78,7 @@
void Map_Version_Data_Packet::Write
- (FileSystem & fs, Editor_Game_Base & egbase, Map_Map_Object_Saver &)
+ (FileSystem & fs, Editor_Game_Base & egbase, MapMapObjectSaver &)
{
Profile prof;
Section & globs = prof.create_section("global");
=== modified file 'src/scripting/c_utils.cc'
--- src/scripting/c_utils.cc 2014-07-20 07:45:49 +0000
+++ src/scripting/c_utils.cc 2014-07-28 18:15:26 +0000
@@ -64,12 +64,12 @@
return *g;
}
-Widelands::Map_Map_Object_Loader * get_mol(lua_State * const L) {
+Widelands::MapMapObjectLoader * get_mol(lua_State * const L) {
lua_pushstring(L, "mol");
lua_gettable(L, LUA_REGISTRYINDEX);
- Widelands::Map_Map_Object_Loader * mol =
- static_cast<Widelands::Map_Map_Object_Loader *>(lua_touserdata(L, -1));
+ Widelands::MapMapObjectLoader * mol =
+ static_cast<Widelands::MapMapObjectLoader *>(lua_touserdata(L, -1));
lua_pop(L, 1); // pop this userdata
@@ -80,12 +80,12 @@
return mol;
}
-Widelands::Map_Map_Object_Saver * get_mos(lua_State * const L) {
+Widelands::MapMapObjectSaver * get_mos(lua_State * const L) {
lua_pushstring(L, "mos");
lua_gettable(L, LUA_REGISTRYINDEX);
- Widelands::Map_Map_Object_Saver * mos =
- static_cast<Widelands::Map_Map_Object_Saver *>(lua_touserdata(L, -1));
+ Widelands::MapMapObjectSaver * mos =
+ static_cast<Widelands::MapMapObjectSaver *>(lua_touserdata(L, -1));
lua_pop(L, 1); // pop this userdata
=== modified file 'src/scripting/c_utils.h'
--- src/scripting/c_utils.h 2014-07-05 16:41:51 +0000
+++ src/scripting/c_utils.h 2014-07-28 18:15:26 +0000
@@ -30,8 +30,8 @@
Factory & get_factory(lua_State *);
Widelands::Game & get_game(lua_State *);
Widelands::Editor_Game_Base & get_egbase(lua_State *);
-Widelands::Map_Map_Object_Loader * get_mol(lua_State *);
-Widelands::Map_Map_Object_Saver * get_mos(lua_State *);
+Widelands::MapMapObjectLoader * get_mol(lua_State *);
+Widelands::MapMapObjectSaver * get_mos(lua_State *);
#ifdef __GNUC__
void report_error(lua_State*, const char*, ...)
=== modified file 'src/scripting/lua_bases.cc'
--- src/scripting/lua_bases.cc 2014-07-25 22:38:39 +0000
+++ src/scripting/lua_bases.cc 2014-07-28 18:15:26 +0000
@@ -167,7 +167,7 @@
if (building_index == INVALID_INDEX) {
report_error(L, "Building %s does not exist", building_name.c_str());
}
- const Building_Descr* building_description = tribe_description->get_building_descr(building_index);
+ const BuildingDescr* building_description = tribe_description->get_building_descr(building_index);
return LuaMap::upcasted_map_object_descr_to_lua(L, building_description);
}
@@ -226,7 +226,7 @@
if (worker_index == INVALID_INDEX) {
report_error(L, "Worker %s does not exist", worker_name.c_str());
}
- const Worker_Descr* worker_description = tribe_description->get_worker_descr(worker_index);
+ const WorkerDescr* worker_description = tribe_description->get_worker_descr(worker_index);
return LuaMap::upcasted_map_object_descr_to_lua(L, worker_description);
}
@@ -438,7 +438,7 @@
r = &get(L, egbase).force_road(path);
} else {
BaseImmovable * bi = map.get_immovable(current);
- if (!bi || bi->descr().type() != Map_Object_Type::FLAG) {
+ if (!bi || bi->descr().type() != MapObjectType::FLAG) {
if (!get(L, egbase).build_flag(current))
report_error(L, "Could not place end flag!");
}
@@ -489,7 +489,7 @@
if (i == INVALID_INDEX)
report_error(L, "Unknown Building: '%s'", name);
- Building_Descr::FormerBuildings former_buildings;
+ BuildingDescr::FormerBuildings former_buildings;
find_former_buildings(td, i, &former_buildings);
if (constructionsite) {
former_buildings.pop_back();
=== modified file 'src/scripting/lua_coroutine.cc'
--- src/scripting/lua_coroutine.cc 2014-06-18 17:11:08 +0000
+++ src/scripting/lua_coroutine.cc 2014-07-28 18:15:26 +0000
@@ -102,7 +102,7 @@
++m_ninput_args;
}
-void LuaCoroutine::push_arg(const Widelands::Building_Descr* building_descr) {
+void LuaCoroutine::push_arg(const Widelands::BuildingDescr* building_descr) {
assert(building_descr != nullptr);
to_lua<LuaMap::L_BuildingDescription>(m_L, new LuaMap::L_BuildingDescription(building_descr));
++m_ninput_args;
=== modified file 'src/scripting/lua_coroutine.h'
--- src/scripting/lua_coroutine.h 2014-07-11 22:53:34 +0000
+++ src/scripting/lua_coroutine.h 2014-07-28 18:15:26 +0000
@@ -31,7 +31,7 @@
namespace Widelands {
class Player;
-struct Building_Descr;
+struct BuildingDescr;
struct Coords;
} // namespace Widelands
@@ -60,7 +60,7 @@
// in hooks.
void push_arg(const Widelands::Player*);
void push_arg(const Widelands::Coords&);
- void push_arg(const Widelands::Building_Descr*);
+ void push_arg(const Widelands::BuildingDescr*);
// Accesses the returned values from the run of the coroutine.
uint32_t pop_uint32();
=== modified file 'src/scripting/lua_game.cc'
--- src/scripting/lua_game.cc 2014-07-25 22:38:39 +0000
+++ src/scripting/lua_game.cc 2014-07-28 18:15:26 +0000
@@ -773,7 +773,7 @@
tribe.worker_types_without_cost();
for (Ware_Index i = 0; i < tribe.get_nrworkers(); ++i) {
- const Worker_Descr & worker_descr = *tribe.get_worker_descr(i);
+ const WorkerDescr & worker_descr = *tribe.get_worker_descr(i);
if (!worker_descr.is_buildable())
continue;
=== modified file 'src/scripting/lua_map.cc'
--- src/scripting/lua_map.cc 2014-07-26 10:43:23 +0000
+++ src/scripting/lua_map.cc 2014-07-28 18:15:26 +0000
@@ -76,11 +76,11 @@
}
-struct SoldierDescr {
- SoldierDescr(uint8_t ghp, uint8_t gat, uint8_t gde, uint8_t gev)
+struct SoldierMapDescr {
+ SoldierMapDescr(uint8_t ghp, uint8_t gat, uint8_t gde, uint8_t gev)
: hp(ghp), at(gat), de(gde), ev(gev) {
}
- SoldierDescr() : hp(0), at(0), de(0), ev(0) {
+ SoldierMapDescr() : hp(0), at(0), de(0), ev(0) {
}
uint8_t hp;
@@ -88,7 +88,7 @@
uint8_t de;
uint8_t ev;
- bool operator<(const SoldierDescr& ot) const {
+ bool operator<(const SoldierMapDescr& ot) const {
bool hp_eq = hp == ot.hp;
bool at_eq = at == ot.at;
bool de_eq = de == ot.de;
@@ -100,17 +100,17 @@
return at < ot.at;
return hp < ot.hp;
}
- bool operator == (const SoldierDescr& ot) const {
+ bool operator == (const SoldierMapDescr& ot) const {
if (hp == ot.hp && at == ot.at && de == ot.de && ev == ot.ev)
return true;
return false;
}
};
-typedef std::map<SoldierDescr, uint32_t> SoldiersMap;
+typedef std::map<SoldierMapDescr, uint32_t> SoldiersMap;
typedef std::map<Widelands::Ware_Index, uint32_t> WaresMap;
typedef std::map<Widelands::Ware_Index, uint32_t> WorkersMap;
-typedef std::pair<SoldierDescr, uint32_t> SoldierAmount;
+typedef std::pair<SoldierMapDescr, uint32_t> SoldierAmount;
typedef std::pair<Widelands::Ware_Index, uint32_t> WorkerAmount;
typedef std::pair<uint8_t, uint32_t> PlrInfluence;
typedef std::set<Widelands::Ware_Index> WaresSet;
@@ -311,7 +311,7 @@
// The idea is to change as little as possible
Editor_Game_Base& egbase = get_egbase(L);
for (const WorkersMap::value_type sp : setpoints) {
- const Worker_Descr* wdes = tribe.get_worker_descr(sp.first);
+ const WorkerDescr* wdes = tribe.get_worker_descr(sp.first);
if (!valid_workers.count(sp.first))
report_error(L, "<%s> can't be employed here!", wdes->name().c_str());
@@ -341,9 +341,9 @@
}
// Unpacks the Lua table of the form {hp, at, de, ev} at the stack index
-// 'table_index' into a SoldierDescr struct.
-SoldierDescr unbox_lua_soldier_description(lua_State* L, int table_index, const Soldier_Descr& sd) {
- SoldierDescr soldier_descr;
+// 'table_index' into a SoldierMapDescr struct.
+SoldierMapDescr unbox_lua_soldier_description(lua_State* L, int table_index, const SoldierDescr& sd) {
+ SoldierMapDescr soldier_descr;
lua_pushuint32(L, 1);
lua_rawget(L, table_index);
@@ -383,17 +383,17 @@
// Parser the arguments of set_soldiers() into a setpoint. See the
// documentation in HasSoldiers to understand the valid arguments.
-SoldiersMap m_parse_set_soldiers_arguments(lua_State* L, const Soldier_Descr& soldier_descr) {
+SoldiersMap m_parse_set_soldiers_arguments(lua_State* L, const SoldierDescr& soldier_descr) {
SoldiersMap rv;
if (lua_gettop(L) > 2) {
// STACK: cls, descr, count
const uint32_t count = luaL_checkuint32(L, 3);
- const SoldierDescr d = unbox_lua_soldier_description(L, 2, soldier_descr);
+ const SoldierMapDescr d = unbox_lua_soldier_description(L, 2, soldier_descr);
rv.insert(SoldierAmount(d, count));
} else {
lua_pushnil(L);
while (lua_next(L, 2) != 0) {
- const SoldierDescr d = unbox_lua_soldier_description(L, 3, soldier_descr);
+ const SoldierMapDescr d = unbox_lua_soldier_description(L, 3, soldier_descr);
const uint32_t count = luaL_checkuint32(L, -1);
rv.insert(SoldierAmount(d, count));
lua_pop(L, 1);
@@ -415,7 +415,7 @@
// Return All Soldiers
SoldiersMap hist;
for (const Soldier* s : soldiers) {
- SoldierDescr sd
+ SoldierMapDescr sd
(s->get_hp_level(), s->get_attack_level(),
s->get_defense_level(), s->get_evade_level());
@@ -444,14 +444,14 @@
lua_rawset(L, -3);
}
} else {
- const Soldier_Descr& soldier_descr = ref_cast<Soldier_Descr const, Worker_Descr const>
+ const SoldierDescr& soldier_descr = ref_cast<SoldierDescr const, WorkerDescr const>
(*tribe.get_worker_descr(tribe.worker_index("soldier")));
// Only return the number of those requested
- const SoldierDescr wanted = unbox_lua_soldier_description(L, 2, soldier_descr);
+ const SoldierMapDescr wanted = unbox_lua_soldier_description(L, 2, soldier_descr);
uint32_t rv = 0;
for (const Soldier* s : soldiers) {
- SoldierDescr sd
+ SoldierMapDescr sd
(s->get_hp_level(), s->get_attack_level(), s->get_defense_level(), s->get_evade_level());
if (sd == wanted)
++rv;
@@ -469,8 +469,8 @@
assert(owner != nullptr);
const Tribe_Descr& tribe = owner->tribe();
- const Soldier_Descr& soldier_descr = // soldiers
- ref_cast<Soldier_Descr const, Worker_Descr const>
+ const SoldierDescr& soldier_descr = // soldiers
+ ref_cast<SoldierDescr const, WorkerDescr const>
(*tribe.get_worker_descr(tribe.worker_index("soldier")));
SoldiersMap setpoints = m_parse_set_soldiers_arguments(L, soldier_descr);
@@ -478,7 +478,7 @@
const std::vector<Soldier*> curs = sc->stationedSoldiers();
SoldiersMap hist;
for (const Soldier* s : curs) {
- SoldierDescr sd
+ SoldierMapDescr sd
(s->get_hp_level(), s->get_attack_level(),
s->get_defense_level(), s->get_evade_level());
@@ -503,7 +503,7 @@
if (d < 0) {
while (d) {
for (Soldier* s : sc->stationedSoldiers()) {
- SoldierDescr is
+ SoldierMapDescr is
(s->get_hp_level(), s->get_attack_level(),
s->get_defense_level(), s->get_evade_level());
@@ -540,38 +540,38 @@
*/
#define CAST_TO_LUA(klass, lua_klass) to_lua<lua_klass> \
(L, new lua_klass(static_cast<const klass *>(descr)))
-int upcasted_map_object_descr_to_lua(lua_State* L, const Map_Object_Descr* const descr) {
+int upcasted_map_object_descr_to_lua(lua_State* L, const MapObjectDescr* const descr) {
assert(descr != nullptr);
- if (descr->type() >= Map_Object_Type::BUILDING)
+ if (descr->type() >= MapObjectType::BUILDING)
{
switch (descr->type()) {
- case Map_Object_Type::CONSTRUCTIONSITE:
- return CAST_TO_LUA(ConstructionSite_Descr, L_ConstructionSiteDescription);
- case Map_Object_Type::PRODUCTIONSITE:
- return CAST_TO_LUA(ProductionSite_Descr, L_ProductionSiteDescription);
- case Map_Object_Type::MILITARYSITE:
- return CAST_TO_LUA(MilitarySite_Descr, L_MilitarySiteDescription);
- case Map_Object_Type::WAREHOUSE:
- return CAST_TO_LUA(Warehouse_Descr, L_WarehouseDescription);
- case Map_Object_Type::TRAININGSITE:
- return CAST_TO_LUA(TrainingSite_Descr, L_TrainingSiteDescription);
+ case MapObjectType::CONSTRUCTIONSITE:
+ return CAST_TO_LUA(ConstructionSiteDescr, L_ConstructionSiteDescription);
+ case MapObjectType::PRODUCTIONSITE:
+ return CAST_TO_LUA(ProductionSiteDescr, L_ProductionSiteDescription);
+ case MapObjectType::MILITARYSITE:
+ return CAST_TO_LUA(MilitarySiteDescr, L_MilitarySiteDescription);
+ case MapObjectType::WAREHOUSE:
+ return CAST_TO_LUA(WarehouseDescr, L_WarehouseDescription);
+ case MapObjectType::TRAININGSITE:
+ return CAST_TO_LUA(TrainingSiteDescr, L_TrainingSiteDescription);
default:
- return CAST_TO_LUA(Building_Descr, L_BuildingDescription);
+ return CAST_TO_LUA(BuildingDescr, L_BuildingDescription);
}
}
else {
switch (descr->type()) {
- case Map_Object_Type::WARE:
+ case MapObjectType::WARE:
return CAST_TO_LUA(WareDescr, L_WareDescription);
- case Map_Object_Type::WORKER:
- return CAST_TO_LUA(Worker_Descr, L_WorkerDescription);
- case Map_Object_Type::CARRIER:
- return CAST_TO_LUA(Worker_Descr, L_WorkerDescription);
- case Map_Object_Type::SOLDIER:
- return CAST_TO_LUA(Worker_Descr, L_WorkerDescription);
+ case MapObjectType::WORKER:
+ return CAST_TO_LUA(WorkerDescr, L_WorkerDescription);
+ case MapObjectType::CARRIER:
+ return CAST_TO_LUA(WorkerDescr, L_WorkerDescription);
+ case MapObjectType::SOLDIER:
+ return CAST_TO_LUA(WorkerDescr, L_WorkerDescription);
default:
- return CAST_TO_LUA(Map_Object_Descr, L_MapObjectDescription);
+ return CAST_TO_LUA(MapObjectDescr, L_MapObjectDescription);
}
}
}
@@ -584,47 +584,47 @@
*/
#define CAST_TO_LUA(k) to_lua<L_ ##k> \
(L, new L_ ##k(*static_cast<k *>(mo)))
-int upcasted_map_object_to_lua(lua_State * L, Map_Object * mo) {
+int upcasted_map_object_to_lua(lua_State * L, MapObject * mo) {
if (!mo)
return 0;
switch (mo->descr().type()) {
- case Map_Object_Type::CRITTER:
+ case MapObjectType::CRITTER:
return CAST_TO_LUA(Bob);
- case Map_Object_Type::SHIP:
+ case MapObjectType::SHIP:
return CAST_TO_LUA(Ship);
- case Map_Object_Type::WORKER:
+ case MapObjectType::WORKER:
return CAST_TO_LUA(Worker);
- case Map_Object_Type::CARRIER:
+ case MapObjectType::CARRIER:
// TODO(sirver): not yet implemented
return CAST_TO_LUA(Worker);
- case Map_Object_Type::SOLDIER:
+ case MapObjectType::SOLDIER:
return CAST_TO_LUA(Soldier);
- case Map_Object_Type::IMMOVABLE:
+ case MapObjectType::IMMOVABLE:
return CAST_TO_LUA(BaseImmovable);
- case Map_Object_Type::FLAG:
+ case MapObjectType::FLAG:
return CAST_TO_LUA(Flag);
- case Map_Object_Type::ROAD:
+ case MapObjectType::ROAD:
return CAST_TO_LUA(Road);
- case Map_Object_Type::PORTDOCK:
+ case MapObjectType::PORTDOCK:
return CAST_TO_LUA(PortDock);
- case Map_Object_Type::BUILDING:
+ case MapObjectType::BUILDING:
return CAST_TO_LUA(Building);
- case Map_Object_Type::CONSTRUCTIONSITE:
+ case MapObjectType::CONSTRUCTIONSITE:
return CAST_TO_LUA(ConstructionSite);
- case Map_Object_Type::DISMANTLESITE:
+ case MapObjectType::DISMANTLESITE:
// TODO(sirver): not yet implemented.
return CAST_TO_LUA(Building);
- case Map_Object_Type::WAREHOUSE:
+ case MapObjectType::WAREHOUSE:
return CAST_TO_LUA(Warehouse);
- case Map_Object_Type::PRODUCTIONSITE:
+ case MapObjectType::PRODUCTIONSITE:
return CAST_TO_LUA(ProductionSite);
- case Map_Object_Type::MILITARYSITE:
+ case MapObjectType::MILITARYSITE:
return CAST_TO_LUA(MilitarySite);
- case Map_Object_Type::TRAININGSITE:
+ case MapObjectType::TRAININGSITE:
return CAST_TO_LUA(TrainingSite);
default:
@@ -1155,7 +1155,7 @@
void L_BuildingDescription::__persist(lua_State* L) {
- const Building_Descr* descr = get();
+ const BuildingDescr* descr = get();
PERS_STRING("tribe", descr->tribe().name());
PERS_STRING("name", descr->name());
}
@@ -1393,7 +1393,7 @@
*/
int L_ProductionSiteDescription::get_inputs(lua_State * L) {
const Tribe_Descr& tribe = get()->tribe();
- const ProductionSite_Descr * descr = get();
+ const ProductionSiteDescr * descr = get();
lua_newtable(L);
int index = 1;
@@ -1412,7 +1412,7 @@
*/
int L_ProductionSiteDescription::get_output_ware_types(lua_State * L) {
const Tribe_Descr& tribe = get()->tribe();
- const ProductionSite_Descr * descr = get();
+ const ProductionSiteDescr * descr = get();
lua_newtable(L);
int index = 1;
@@ -1432,7 +1432,7 @@
*/
int L_ProductionSiteDescription::get_output_worker_types(lua_State * L) {
const Tribe_Descr& tribe = get()->tribe();
- const ProductionSite_Descr * descr = get();
+ const ProductionSiteDescr * descr = get();
lua_newtable(L);
int index = 1;
@@ -1453,7 +1453,7 @@
*/
int L_ProductionSiteDescription::get_working_positions(lua_State * L) {
const Tribe_Descr& tribe = get()->tribe();
- const ProductionSite_Descr * descr = get();
+ const ProductionSiteDescr * descr = get();
lua_newtable(L);
int index = 1;
@@ -1506,7 +1506,7 @@
(RO) The number of health healed per second by the militarysite
*/
int L_MilitarySiteDescription::get_heal_per_second(lua_State * L) {
- const MilitarySite_Descr * descr = get();
+ const MilitarySiteDescr * descr = get();
lua_pushinteger(L, descr->get_heal_per_second());
return 1;
}
@@ -1517,7 +1517,7 @@
(RO) The number of soldiers that can be garrisoned at the militarysite
*/
int L_MilitarySiteDescription::get_max_number_of_soldiers(lua_State * L) {
- const MilitarySite_Descr * descr = get();
+ const MilitarySiteDescr * descr = get();
lua_pushinteger(L, descr->get_max_number_of_soldiers());
return 1;
}
@@ -1562,7 +1562,7 @@
(RO) The number of attack points that a soldier can train
*/
int L_TrainingSiteDescription::get_max_attack(lua_State * L) {
- const TrainingSite_Descr* descr = get();
+ const TrainingSiteDescr* descr = get();
if (descr->get_train_attack())
lua_pushinteger(L, descr->get_max_level(atrAttack));
else
@@ -1576,7 +1576,7 @@
(RO) The number of defense points that a soldier can train
*/
int L_TrainingSiteDescription::get_max_defense(lua_State * L) {
- const TrainingSite_Descr* descr = get();
+ const TrainingSiteDescr* descr = get();
if (descr->get_train_defense())
lua_pushinteger(L, descr->get_max_level(atrDefense));
else
@@ -1591,7 +1591,7 @@
(RO) The number of evade points that a soldier can train
*/
int L_TrainingSiteDescription::get_max_evade(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_evade())
lua_pushinteger(L, descr->get_max_level(atrEvade));
else lua_pushnil(L);
@@ -1605,7 +1605,7 @@
(RO) The number of health points that a soldier can train
*/
int L_TrainingSiteDescription::get_max_hp(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_hp())
lua_pushinteger(L, descr->get_max_level(atrHP));
else lua_pushnil(L);
@@ -1619,7 +1619,7 @@
(RO) The number of soldiers that can be garrisoned at the trainingsite
*/
int L_TrainingSiteDescription::get_max_number_of_soldiers(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
lua_pushinteger(L, descr->get_max_number_of_soldiers());
return 1;
}
@@ -1631,7 +1631,7 @@
(RO) The number of attack points that a soldier starts training with
*/
int L_TrainingSiteDescription::get_min_attack(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_attack())
lua_pushinteger(L, descr->get_min_level(atrAttack));
else lua_pushnil(L);
@@ -1644,7 +1644,7 @@
(RO) The number of defense points that a soldier starts training with
*/
int L_TrainingSiteDescription::get_min_defense(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_defense())
lua_pushinteger(L, descr->get_min_level(atrDefense));
else lua_pushnil(L);
@@ -1658,7 +1658,7 @@
(RO) The number of evade points that a soldier starts training with
*/
int L_TrainingSiteDescription::get_min_evade(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_evade())
lua_pushinteger(L, descr->get_min_level(atrEvade));
else lua_pushnil(L);
@@ -1672,7 +1672,7 @@
(RO) The number of health points that a soldier starts training with
*/
int L_TrainingSiteDescription::get_min_hp(lua_State * L) {
- const TrainingSite_Descr * descr = get();
+ const TrainingSiteDescr * descr = get();
if (descr->get_train_hp())
lua_pushinteger(L, descr->get_min_level(atrHP));
else lua_pushnil(L);
@@ -1715,7 +1715,7 @@
(RO) The number of health healed per second by the warehouse
*/
int L_WarehouseDescription::get_heal_per_second(lua_State * L) {
- const Warehouse_Descr * descr = get();
+ const WarehouseDescr * descr = get();
lua_pushinteger(L, descr->get_heal_per_second());
return 1;
}
@@ -1785,9 +1785,9 @@
for (Building_Index i = 0; i < nr_buildings; ++i) {
- const Building_Descr & descr = *tribe.get_building_descr(i);
+ const BuildingDescr & descr = *tribe.get_building_descr(i);
- if (upcast(ProductionSite_Descr const, de, &descr)) {
+ if (upcast(ProductionSiteDescr const, de, &descr)) {
// inputs() returns type WareAmount = std::pair<Ware_Index, uint32_t>
for (auto ware_amount : de->inputs()) {
if (std::string(get()->name()) ==
@@ -1834,9 +1834,9 @@
for (Building_Index i = 0; i < nr_buildings; ++i) {
- const Building_Descr & descr = *tribe.get_building_descr(i);
+ const BuildingDescr & descr = *tribe.get_building_descr(i);
- if (upcast(ProductionSite_Descr const, de, &descr)) {
+ if (upcast(ProductionSiteDescr const, de, &descr)) {
for (auto ware_index : de->output_ware_types()) {
if (std::string(get()->name()) ==
std::string(tribe.get_ware_descr(ware_index)->name())) {
@@ -1877,7 +1877,7 @@
void L_WorkerDescription::__persist(lua_State* L) {
- const Worker_Descr * descr = get();
+ const WorkerDescr * descr = get();
PERS_STRING("tribe", descr->tribe().name());
PERS_STRING("name", descr->name());
}
@@ -2009,11 +2009,11 @@
};
void L_MapObject::__persist(lua_State * L) {
- Map_Map_Object_Saver & mos = *get_mos(L);
+ MapMapObjectSaver & mos = *get_mos(L);
Game & game = get_game(L);
uint32_t idx = 0;
- if (Map_Object* obj = m_ptr.get(game))
+ if (MapObject* obj = m_ptr.get(game))
idx = mos.get_object_file_index(*obj);
PERS_UINT32("file_index", idx);
@@ -2025,8 +2025,8 @@
if (!idx)
m_ptr = nullptr;
else {
- Map_Map_Object_Loader& mol = *get_mol(L);
- m_ptr = &mol.get<Map_Object>(idx);
+ MapMapObjectLoader& mol = *get_mol(L);
+ m_ptr = &mol.get<MapObject>(idx);
}
}
@@ -2076,30 +2076,28 @@
(RO) The description object for this immovable, e.g. BuildingDescription.
*/
int L_MapObject::get_descr(lua_State * L) {
- //TODO(GunChleoc): Flag_Descr would be nice for getting the type of immovables,
- // at the moment the type for these can be faked by using their name instead
- const Map_Object_Descr* desc = &get(L, get_egbase(L))->descr();
+ const MapObjectDescr* desc = &get(L, get_egbase(L))->descr();
assert(desc != nullptr);
- if (is_a(MilitarySite_Descr, desc)) {
- return CAST_TO_LUA(MilitarySite_Descr, L_MilitarySiteDescription);
- }
- else if (is_a(TrainingSite_Descr, desc)) {
- return CAST_TO_LUA(TrainingSite_Descr, L_TrainingSiteDescription);
- }
- else if (is_a(ProductionSite_Descr, desc)) {
- return CAST_TO_LUA(ProductionSite_Descr, L_ProductionSiteDescription);
- }
- else if (is_a(Warehouse_Descr, desc)) {
- return CAST_TO_LUA(Warehouse_Descr, L_WarehouseDescription);
- }
- else if (is_a(ConstructionSite_Descr, desc)) {
- return CAST_TO_LUA(ConstructionSite_Descr, L_ConstructionSiteDescription);
- }
- else if (is_a(Building_Descr, desc)) {
- return CAST_TO_LUA(Building_Descr, L_BuildingDescription);
- }
- return CAST_TO_LUA(Map_Object_Descr, L_MapObjectDescription);
+ if (is_a(MilitarySiteDescr, desc)) {
+ return CAST_TO_LUA(MilitarySiteDescr, L_MilitarySiteDescription);
+ }
+ else if (is_a(TrainingSiteDescr, desc)) {
+ return CAST_TO_LUA(TrainingSiteDescr, L_TrainingSiteDescription);
+ }
+ else if (is_a(ProductionSiteDescr, desc)) {
+ return CAST_TO_LUA(ProductionSiteDescr, L_ProductionSiteDescription);
+ }
+ else if (is_a(WarehouseDescr, desc)) {
+ return CAST_TO_LUA(WarehouseDescr, L_WarehouseDescription);
+ }
+ else if (is_a(ConstructionSiteDescr, desc)) {
+ return CAST_TO_LUA(ConstructionSiteDescr, L_ConstructionSiteDescription);
+ }
+ else if (is_a(BuildingDescr, desc)) {
+ return CAST_TO_LUA(BuildingDescr, L_BuildingDescription);
+ }
+ return CAST_TO_LUA(MapObjectDescr, L_MapObjectDescription);
}
#undef CAST_TO_LUA
@@ -2114,8 +2112,8 @@
Editor_Game_Base & egbase = get_egbase(L);
L_MapObject * other = *get_base_user_class<L_MapObject>(L, -1);
- Map_Object * me = m_get_or_zero(egbase);
- Map_Object * you = other->m_get_or_zero(egbase);
+ MapObject * me = m_get_or_zero(egbase);
+ MapObject * you = other->m_get_or_zero(egbase);
// Both objects are destroyed: they are equal
if (me == you) lua_pushboolean(L, true);
@@ -2136,7 +2134,7 @@
*/
int L_MapObject::remove(lua_State * L) {
Editor_Game_Base & egbase = get_egbase(L);
- Map_Object* o = get(L, egbase);
+ MapObject* o = get(L, egbase);
if (!o)
return 0;
@@ -2153,7 +2151,7 @@
*/
int L_MapObject::destroy(lua_State * L) {
Editor_Game_Base& egbase = get_egbase(L);
- Map_Object* o = get(L, egbase);
+ MapObject* o = get(L, egbase);
if (!o)
return 0;
@@ -2168,7 +2166,7 @@
*/
int L_MapObject::has_attribute(lua_State * L) {
Editor_Game_Base & egbase = get_egbase(L);
- Map_Object * obj = m_get_or_zero(egbase);
+ MapObject * obj = m_get_or_zero(egbase);
if (!obj) {
lua_pushboolean(L, false);
return 1;
@@ -2176,7 +2174,7 @@
// Check if object has the attribute
std::string attrib = luaL_checkstring(L, 2);
- if (obj->has_attribute(Map_Object_Descr::get_attribute_id(attrib)))
+ if (obj->has_attribute(MapObjectDescr::get_attribute_id(attrib)))
lua_pushboolean(L, true);
else
lua_pushboolean(L, false);
@@ -2188,13 +2186,13 @@
C METHODS
==========================================================
*/
-Map_Object* L_MapObject::get(lua_State* L, Editor_Game_Base& egbase, std::string name) {
- Map_Object* o = m_get_or_zero(egbase);
+MapObject* L_MapObject::get(lua_State* L, Editor_Game_Base& egbase, std::string name) {
+ MapObject* o = m_get_or_zero(egbase);
if (!o)
report_error(L, "%s no longer exists!", name.c_str());
return o;
}
-Map_Object* L_MapObject::m_get_or_zero(Editor_Game_Base& egbase) {
+MapObject* L_MapObject::m_get_or_zero(Editor_Game_Base& egbase) {
return m_ptr.get(egbase);
}
@@ -2586,7 +2584,7 @@
*/
int L_Road::create_new_worker
- (PlayerImmovable & pi, Editor_Game_Base & egbase, const Worker_Descr * wdes)
+ (PlayerImmovable & pi, Editor_Game_Base & egbase, const WorkerDescr * wdes)
{
Road & r = static_cast<Road &>(pi);
@@ -3005,7 +3003,7 @@
*/
int L_ProductionSite::create_new_worker
- (PlayerImmovable & pi, Editor_Game_Base & egbase, const Worker_Descr * wdes)
+ (PlayerImmovable & pi, Editor_Game_Base & egbase, const WorkerDescr * wdes)
{
ProductionSite & ps = static_cast<ProductionSite &>(pi);
return ps.warp_worker(egbase, *wdes);
=== modified file 'src/scripting/lua_map.h'
--- src/scripting/lua_map.h 2014-07-26 10:43:23 +0000
+++ src/scripting/lua_map.h 2014-07-28 18:15:26 +0000
@@ -39,10 +39,10 @@
namespace Widelands {
- struct Soldier_Descr;
- struct Building_Descr;
+ struct SoldierDescr;
+ struct BuildingDescr;
struct WareDescr;
- class Worker_Descr;
+ class WorkerDescr;
class Bob;
}
@@ -99,7 +99,7 @@
virtual ~L_MapObjectDescription() {}
L_MapObjectDescription() : mapobjectdescr_(nullptr) {}
- L_MapObjectDescription(const Widelands::Map_Object_Descr* const mapobjectdescr)
+ L_MapObjectDescription(const Widelands::MapObjectDescr* const mapobjectdescr)
: mapobjectdescr_(mapobjectdescr) {}
L_MapObjectDescription(lua_State* L) : mapobjectdescr_(nullptr) {
report_error(L, "Cannot instantiate a 'MapObjectDescription' directly!");
@@ -124,17 +124,17 @@
* C methods
*/
protected:
- const Widelands::Map_Object_Descr* get() const {
+ const Widelands::MapObjectDescr* get() const {
assert(mapobjectdescr_ != nullptr);
return mapobjectdescr_;
}
// For persistence.
- void set_description_pointer(const Widelands::Map_Object_Descr* pointer) {
+ void set_description_pointer(const Widelands::MapObjectDescr* pointer) {
mapobjectdescr_ = pointer;
}
private:
- const Widelands::Map_Object_Descr* mapobjectdescr_;
+ const Widelands::MapObjectDescr* mapobjectdescr_;
};
#define CASTED_GET_DESCRIPTION(klass) \
@@ -149,7 +149,7 @@
virtual ~L_BuildingDescription() {}
L_BuildingDescription() {}
- L_BuildingDescription(const Widelands::Building_Descr* const buildingdescr)
+ L_BuildingDescription(const Widelands::BuildingDescr* const buildingdescr)
: L_MapObjectDescription(buildingdescr) {
}
L_BuildingDescription(lua_State* L) : L_MapObjectDescription(L) {
@@ -187,7 +187,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(Building_Descr)
+ CASTED_GET_DESCRIPTION(BuildingDescr)
};
@@ -198,7 +198,7 @@
virtual ~L_ConstructionSiteDescription() {}
L_ConstructionSiteDescription() {}
- L_ConstructionSiteDescription(const Widelands::ConstructionSite_Descr* const constructionsitedescr)
+ L_ConstructionSiteDescription(const Widelands::ConstructionSiteDescr* const constructionsitedescr)
: L_BuildingDescription(constructionsitedescr) {
}
L_ConstructionSiteDescription(lua_State* L) : L_BuildingDescription(L) {
@@ -217,7 +217,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(ConstructionSite_Descr)
+ CASTED_GET_DESCRIPTION(ConstructionSiteDescr)
};
@@ -228,7 +228,7 @@
virtual ~L_ProductionSiteDescription() {}
L_ProductionSiteDescription() {}
- L_ProductionSiteDescription(const Widelands::ProductionSite_Descr* const productionsitedescr)
+ L_ProductionSiteDescription(const Widelands::ProductionSiteDescr* const productionsitedescr)
: L_BuildingDescription(productionsitedescr) {
}
L_ProductionSiteDescription(lua_State* L) : L_BuildingDescription(L) {
@@ -251,7 +251,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(ProductionSite_Descr)
+ CASTED_GET_DESCRIPTION(ProductionSiteDescr)
};
@@ -262,7 +262,7 @@
virtual ~L_MilitarySiteDescription() {}
L_MilitarySiteDescription() {}
- L_MilitarySiteDescription(const Widelands::ProductionSite_Descr* const militarysitedescr)
+ L_MilitarySiteDescription(const Widelands::ProductionSiteDescr* const militarysitedescr)
: L_ProductionSiteDescription(militarysitedescr) {
}
L_MilitarySiteDescription(lua_State* L) : L_ProductionSiteDescription(L) {
@@ -283,7 +283,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(MilitarySite_Descr)
+ CASTED_GET_DESCRIPTION(MilitarySiteDescr)
};
@@ -294,7 +294,7 @@
virtual ~L_TrainingSiteDescription() {}
L_TrainingSiteDescription() {}
- L_TrainingSiteDescription(const Widelands::ProductionSite_Descr* const trainingsitedescr)
+ L_TrainingSiteDescription(const Widelands::ProductionSiteDescr* const trainingsitedescr)
: L_ProductionSiteDescription(trainingsitedescr) {
}
L_TrainingSiteDescription(lua_State* L) : L_ProductionSiteDescription(L) {
@@ -322,7 +322,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(TrainingSite_Descr)
+ CASTED_GET_DESCRIPTION(TrainingSiteDescr)
};
@@ -334,7 +334,7 @@
virtual ~L_WarehouseDescription() {}
L_WarehouseDescription() {}
- L_WarehouseDescription(const Widelands::Warehouse_Descr* const warehousedescr)
+ L_WarehouseDescription(const Widelands::WarehouseDescr* const warehousedescr)
: L_BuildingDescription(warehousedescr) {
}
L_WarehouseDescription(lua_State* L) : L_BuildingDescription(L) {
@@ -354,7 +354,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(Warehouse_Descr)
+ CASTED_GET_DESCRIPTION(WarehouseDescr)
};
@@ -401,7 +401,7 @@
virtual ~L_WorkerDescription() {}
L_WorkerDescription() {}
- L_WorkerDescription(const Widelands::Worker_Descr* const workerdescr)
+ L_WorkerDescription(const Widelands::WorkerDescr* const workerdescr)
: L_MapObjectDescription(workerdescr) {
}
L_WorkerDescription(lua_State* L) : L_MapObjectDescription(L) {
@@ -428,7 +428,7 @@
*/
private:
- CASTED_GET_DESCRIPTION(Worker_Descr)
+ CASTED_GET_DESCRIPTION(WorkerDescr)
};
#undef CASTED_GET_DESCRIPTION
@@ -446,7 +446,7 @@
LUNA_CLASS_HEAD(L_MapObject);
L_MapObject() : m_ptr(nullptr) {}
- L_MapObject(Widelands::Map_Object & mo) {
+ L_MapObject(Widelands::MapObject & mo) {
m_ptr = &mo;
}
L_MapObject(lua_State * L) : m_ptr(nullptr) {
@@ -478,9 +478,9 @@
/*
* C Methods
*/
- Widelands::Map_Object * get
+ Widelands::MapObject * get
(lua_State *, Widelands::Editor_Game_Base &, std::string = "MapObject");
- Widelands::Map_Object * m_get_or_zero(Widelands::Editor_Game_Base &);
+ Widelands::MapObject * m_get_or_zero(Widelands::Editor_Game_Base &);
};
@@ -641,7 +641,7 @@
CASTED_GET(Road)
static int create_new_worker
(Widelands::PlayerImmovable &,
- Widelands::Editor_Game_Base &, const Widelands::Worker_Descr *);
+ Widelands::Editor_Game_Base &, const Widelands::WorkerDescr *);
};
@@ -735,7 +735,7 @@
CASTED_GET(ProductionSite)
static int create_new_worker
(Widelands::PlayerImmovable &, Widelands::Editor_Game_Base &,
- const Widelands::Worker_Descr *);
+ const Widelands::WorkerDescr *);
};
class L_MilitarySite : public L_Building {
@@ -997,8 +997,8 @@
*/
};
-int upcasted_map_object_descr_to_lua(lua_State* L, const Widelands::Map_Object_Descr* descr);
-int upcasted_map_object_to_lua(lua_State * L, Widelands::Map_Object * mo);
+int upcasted_map_object_descr_to_lua(lua_State* L, const Widelands::MapObjectDescr* descr);
+int upcasted_map_object_to_lua(lua_State * L, Widelands::MapObject * mo);
void luaopen_wlmap(lua_State *);
=== modified file 'src/scripting/lua_root.cc'
--- src/scripting/lua_root.cc 2014-07-05 12:48:58 +0000
+++ src/scripting/lua_root.cc 2014-07-28 18:15:26 +0000
@@ -22,7 +22,7 @@
#include <boost/format.hpp>
#include "logic/cmd_luacoroutine.h"
-#include "logic/critter_bob.h"
+#include "logic/critter.h"
#include "logic/findimmovable.h"
#include "logic/game.h"
#include "logic/game_controller.h"
=== modified file 'src/scripting/persistence.cc'
--- src/scripting/persistence.cc 2014-06-18 13:20:33 +0000
+++ src/scripting/persistence.cc 2014-07-28 18:15:26 +0000
@@ -176,7 +176,7 @@
*/
uint32_t persist_object
(lua_State * L,
- FileWrite & fw, Widelands::Map_Map_Object_Saver & mos)
+ FileWrite & fw, Widelands::MapMapObjectSaver & mos)
{
assert(lua_gettop(L) == 2); // S: globals_table object
@@ -223,7 +223,7 @@
void unpersist_object
(lua_State * L,
- FileRead & fr, Widelands::Map_Map_Object_Loader & mol,
+ FileRead & fr, Widelands::MapMapObjectLoader & mol,
uint32_t size)
{
assert(lua_gettop(L) == 0); // S:
=== modified file 'src/scripting/persistence.h'
--- src/scripting/persistence.h 2014-07-05 16:41:51 +0000
+++ src/scripting/persistence.h 2014-07-28 18:15:26 +0000
@@ -28,8 +28,8 @@
class FileWrite;
namespace Widelands {
- class Map_Map_Object_Loader;
- struct Map_Map_Object_Saver;
+ class MapMapObjectLoader;
+ struct MapMapObjectSaver;
class Editor_Game_Base;
class Game;
}
@@ -42,13 +42,13 @@
*/
uint32_t persist_object
(lua_State * L,
- FileWrite &, Widelands::Map_Map_Object_Saver &);
+ FileWrite &, Widelands::MapMapObjectSaver &);
// Does all the unpersisting work. The unpersisted object is at the top of the
// stack after the function returns.
void unpersist_object
(lua_State * L,
- FileRead & fr, Widelands::Map_Map_Object_Loader & mol,
+ FileRead & fr, Widelands::MapMapObjectLoader & mol,
uint32_t size);
#endif // end of include guard: WL_SCRIPTING_PERSISTENCE_H
=== modified file 'src/scripting/scripting.cc'
--- src/scripting/scripting.cc 2014-07-20 07:45:49 +0000
+++ src/scripting/scripting.cc 2014-07-28 18:15:26 +0000
@@ -336,7 +336,7 @@
void LuaGameInterface::read_global_env
- (FileRead & fr, Widelands::Map_Map_Object_Loader & mol,
+ (FileRead & fr, Widelands::MapMapObjectLoader & mol,
uint32_t size)
{
// Clean out the garbage before loading.
@@ -375,7 +375,7 @@
}
uint32_t LuaGameInterface::write_global_env
- (FileWrite & fw, Widelands::Map_Map_Object_Saver & mos)
+ (FileWrite & fw, Widelands::MapMapObjectSaver & mos)
{
// Clean out the garbage before writing.
lua_gc(m_L, LUA_GCCOLLECT, 0);
=== modified file 'src/scripting/scripting.h'
--- src/scripting/scripting.h 2014-07-11 22:53:34 +0000
+++ src/scripting/scripting.h 2014-07-28 18:15:26 +0000
@@ -35,8 +35,8 @@
namespace Widelands {
class Editor_Game_Base;
class Game;
- class Map_Map_Object_Loader;
- struct Map_Map_Object_Saver;
+ class MapMapObjectLoader;
+ struct MapMapObjectSaver;
}
class EditorFactory;
@@ -80,9 +80,9 @@
// Input output for the global game state.
void read_global_env
- (FileRead &, Widelands::Map_Map_Object_Loader &, uint32_t);
+ (FileRead &, Widelands::MapMapObjectLoader &, uint32_t);
uint32_t write_global_env
- (FileWrite &, Widelands::Map_Map_Object_Saver &);
+ (FileWrite &, Widelands::MapMapObjectSaver &);
private:
std::unique_ptr<GameFactory> m_factory;
=== modified file 'src/ui_basic/helpwindow.cc'
--- src/ui_basic/helpwindow.cc 2014-07-11 22:53:34 +0000
+++ src/ui_basic/helpwindow.cc 2014-07-28 18:15:26 +0000
@@ -185,7 +185,7 @@
LuaTextHelpWindow::LuaTextHelpWindow
(Panel * const parent,
UI::UniqueWindow::Registry & reg,
- const Widelands::Building_Descr& building_description,
+ const Widelands::BuildingDescr& building_description,
LuaInterface * const lua,
uint32_t width, uint32_t height)
:
=== modified file 'src/ui_basic/helpwindow.h'
--- src/ui_basic/helpwindow.h 2014-07-11 22:53:34 +0000
+++ src/ui_basic/helpwindow.h 2014-07-28 18:15:26 +0000
@@ -30,7 +30,7 @@
class LuaInterface;
namespace Widelands {
-struct Building_Descr;
+struct BuildingDescr;
}
namespace UI {
@@ -89,7 +89,7 @@
struct LuaTextHelpWindow : public UI::UniqueWindow {
LuaTextHelpWindow
(Panel * parent, UI::UniqueWindow::Registry& reg,
- const Widelands::Building_Descr& building_description,
+ const Widelands::BuildingDescr& building_description,
LuaInterface * const lua,
uint32_t width = 300, uint32_t height = 400);
~LuaTextHelpWindow();
=== modified file 'src/wui/building_statistics_menu.cc'
--- src/wui/building_statistics_menu.cc 2014-07-25 13:45:18 +0000
+++ src/wui/building_statistics_menu.cc 2014-07-28 18:15:26 +0000
@@ -344,8 +344,8 @@
const Widelands::Tribe_Descr & tribe = iplayer().player().tribe();
Widelands::Building_Index a = Widelands::Building_Index(m_table[rowa]);
Widelands::Building_Index b = Widelands::Building_Index(m_table[rowb]);
- const Widelands::Building_Descr * descra = tribe.get_building_descr(a);
- const Widelands::Building_Descr * descrb = tribe.get_building_descr(b);
+ const Widelands::BuildingDescr * descra = tribe.get_building_descr(a);
+ const Widelands::BuildingDescr * descrb = tribe.get_building_descr(b);
if (!descra || !descrb)
return false; // shouldn't happen, but be defensive
@@ -378,7 +378,7 @@
i < nr_buildings;
++i)
{
- const Widelands::Building_Descr & building =
+ const Widelands::BuildingDescr & building =
*tribe.get_building_descr(i);
if
(!(building.is_buildable()
@@ -410,7 +410,7 @@
uint32_t nr_owned = 0;
uint32_t nr_build = 0;
uint32_t total_prod = 0;
- upcast(Widelands::ProductionSite_Descr const, productionsite, &building);
+ upcast(Widelands::ProductionSiteDescr const, productionsite, &building);
for (uint32_t l = 0; l < vec.size(); ++l) {
if (vec[l].is_constructionsite)
++nr_build;
=== modified file 'src/wui/building_statistics_menu.h'
--- src/wui/building_statistics_menu.h 2014-07-05 16:41:51 +0000
+++ src/wui/building_statistics_menu.h 2014-07-28 18:15:26 +0000
@@ -25,7 +25,7 @@
#include "ui_basic/textarea.h"
#include "ui_basic/unique_window.h"
-namespace Widelands {struct Building_Descr;}
+namespace Widelands {struct BuildingDescr;}
class Interactive_Player;
namespace UI {
struct Button;
=== modified file 'src/wui/buildingwindow.cc'
--- src/wui/buildingwindow.cc 2014-07-25 22:20:55 +0000
+++ src/wui/buildingwindow.cc 2014-07-28 18:15:26 +0000
@@ -103,7 +103,7 @@
m_registry = nullptr;
}
-namespace Widelands {struct Building_Descr;}
+namespace Widelands {struct BuildingDescr;}
using Widelands::Building;
/*
@@ -226,7 +226,7 @@
m_building.descr().enhancement();
const Widelands::Tribe_Descr & tribe = owner.tribe();
if (owner.is_building_type_allowed(enhancement)) {
- const Widelands::Building_Descr & building_descr =
+ const Widelands::BuildingDescr & building_descr =
*tribe.get_building_descr(enhancement);
char buffer[128];
snprintf
=== modified file 'src/wui/encyclopedia_window.cc'
--- src/wui/encyclopedia_window.cc 2014-07-25 22:17:48 +0000
+++ src/wui/encyclopedia_window.cc 2014-07-28 18:15:26 +0000
@@ -119,8 +119,8 @@
Building_Index const nr_buildings = tribe.get_nrbuildings();
for (Building_Index i = 0; i < nr_buildings; ++i) {
- const Building_Descr & descr = *tribe.get_building_descr(i);
- if (upcast(ProductionSite_Descr const, de, &descr)) {
+ const BuildingDescr & descr = *tribe.get_building_descr(i);
+ if (upcast(ProductionSiteDescr const, de, &descr)) {
if
((descr.is_buildable() || descr.is_enhanced())
@@ -142,8 +142,8 @@
condTable.clear();
const Tribe_Descr & tribe = iaplayer().player().tribe();
- const ProductionSite_Descr::Programs & programs =
- ref_cast<ProductionSite_Descr const, Building_Descr const>
+ const ProductionSiteDescr::Programs & programs =
+ ref_cast<ProductionSiteDescr const, BuildingDescr const>
(*tribe.get_building_descr(prodSites.get_selected()))
.programs();
=== modified file 'src/wui/fieldaction.cc'
--- src/wui/fieldaction.cc 2014-07-26 10:43:23 +0000
+++ src/wui/fieldaction.cc 2014-07-28 18:15:26 +0000
@@ -47,7 +47,7 @@
#include "wui/waresdisplay.h"
#include "wui/watchwindow.h"
-namespace Widelands {struct Building_Descr;}
+namespace Widelands {struct BuildingDescr;}
using Widelands::Building;
using Widelands::Editor_Game_Base;
using Widelands::Game;
@@ -102,7 +102,7 @@
*/
void BuildGrid::add(Widelands::Building_Index id)
{
- const Widelands::Building_Descr & descr =
+ const Widelands::BuildingDescr & descr =
*tribe_.get_building_descr(Widelands::Building_Index(id));
const Image& anim_frame = g_gr->animations().get_animation(descr.get_animation("idle"))
.representative_image(player_color_);
@@ -514,7 +514,7 @@
id < nr_buildings;
++id)
{
- const Widelands::Building_Descr & descr = *tribe.get_building_descr(id);
+ const Widelands::BuildingDescr & descr = *tribe.get_building_descr(id);
BuildGrid * * ppgrid;
// Some building types cannot be built (i.e. construction site) and not
=== modified file 'src/wui/game_debug_ui.cc'
--- src/wui/game_debug_ui.cc 2014-07-26 10:43:23 +0000
+++ src/wui/game_debug_ui.cc 2014-07-28 18:15:26 +0000
@@ -43,12 +43,12 @@
#include "wui/interactive_base.h"
struct MapObjectDebugPanel
-: public UI::Panel, public Widelands::Map_Object::LogSink
+: public UI::Panel, public Widelands::MapObject::LogSink
{
MapObjectDebugPanel
(UI::Panel & parent,
const Widelands::Editor_Game_Base &,
- Widelands::Map_Object &);
+ Widelands::MapObject &);
~MapObjectDebugPanel();
void log(std::string str) override;
@@ -64,7 +64,7 @@
MapObjectDebugPanel::MapObjectDebugPanel
(UI::Panel & parent,
const Widelands::Editor_Game_Base & egbase,
- Widelands::Map_Object & obj)
+ Widelands::MapObject & obj)
:
UI::Panel(&parent, 0, 0, 350, 200),
m_egbase (egbase),
@@ -78,7 +78,7 @@
MapObjectDebugPanel::~MapObjectDebugPanel()
{
- if (Widelands::Map_Object * const obj = m_object.get(m_egbase))
+ if (Widelands::MapObject * const obj = m_object.get(m_egbase))
if (obj->get_logsink() == this)
obj->set_logsink(nullptr);
}
@@ -104,7 +104,7 @@
building_ui.cc).
===============
*/
-void Widelands::Map_Object::create_debug_panels
+void Widelands::MapObject::create_debug_panels
(const Widelands::Editor_Game_Base & egbase, UI::Tab_Panel & tabs)
{
tabs.add
@@ -129,7 +129,7 @@
collect_debug_tabs().
*/
struct MapObjectDebugWindow : public UI::Window {
- MapObjectDebugWindow(Interactive_Base & parent, Widelands::Map_Object &);
+ MapObjectDebugWindow(Interactive_Base & parent, Widelands::MapObject &);
Interactive_Base & ibase() {
return ref_cast<Interactive_Base, UI::Panel>(*get_parent());
@@ -146,7 +146,7 @@
MapObjectDebugWindow::MapObjectDebugWindow
- (Interactive_Base & parent, Widelands::Map_Object & obj)
+ (Interactive_Base & parent, Widelands::MapObject & obj)
:
UI::Window (&parent, "map_object_debug", 0, 0, 100, 100, ""),
m_log_general_info(true),
@@ -175,7 +175,7 @@
void MapObjectDebugWindow::think()
{
Widelands::Editor_Game_Base & egbase = ibase().egbase();
- if (Widelands::Map_Object * const obj = m_object.get(egbase)) {
+ if (Widelands::MapObject * const obj = m_object.get(egbase)) {
if (m_log_general_info) {
obj->log_general_info(egbase);
m_log_general_info = false;
@@ -195,11 +195,11 @@
===============
show_mapobject_debug
-Show debug window for a Map_Object
+Show debug window for a MapObject
===============
*/
void show_mapobject_debug
- (Interactive_Base & parent, Widelands::Map_Object & obj)
+ (Interactive_Base & parent, Widelands::MapObject & obj)
{
new MapObjectDebugWindow(parent, obj);
}
@@ -407,7 +407,7 @@
// Do not clear the list. Instead parse all bobs and sync lists
for (uint32_t idx = 0; idx < m_ui_bobs.size(); idx++) {
- Widelands::Map_Object* mo =
+ Widelands::MapObject* mo =
ibase().egbase().objects().get_object(m_ui_bobs[idx]);
bool toremove = false;
std::vector<Widelands::Bob *>::iterator removeIt;
@@ -465,7 +465,7 @@
void FieldDebugWindow::open_bob(const uint32_t index) {
if (index != UI::Listselect<intptr_t>::no_selection_index())
if
- (Widelands::Map_Object * const object =
+ (Widelands::MapObject * const object =
ibase().egbase().objects().get_object(m_ui_bobs.get_selected()))
show_mapobject_debug(ibase(), *object);
}
=== modified file 'src/wui/game_debug_ui.h'
--- src/wui/game_debug_ui.h 2014-07-14 10:45:44 +0000
+++ src/wui/game_debug_ui.h 2014-07-28 18:15:26 +0000
@@ -24,10 +24,10 @@
#include "logic/widelands_geometry.h"
class Interactive_Base;
-namespace Widelands {class Map_Object;}
+namespace Widelands {class MapObject;}
// Open debug window for the given coordinates
-void show_mapobject_debug(Interactive_Base & parent, Widelands::Map_Object &);
+void show_mapobject_debug(Interactive_Base & parent, Widelands::MapObject &);
void show_field_debug(Interactive_Base & parent, Widelands::Coords coords);
#endif // end of include guard: WL_WUI_GAME_DEBUG_UI_H
=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc 2014-07-25 20:57:37 +0000
+++ src/wui/interactive_base.cc 2014-07-28 18:15:26 +0000
@@ -63,7 +63,7 @@
using Widelands::Editor_Game_Base;
using Widelands::Game;
using Widelands::Map;
-using Widelands::Map_Object;
+using Widelands::MapObject;
using Widelands::TCoords;
struct InteractiveBaseInternals {
@@ -986,11 +986,11 @@
}
uint32_t serial = atoi(args[1].c_str());
- Map_Object * obj = egbase().objects().get_object(serial);
+ MapObject * obj = egbase().objects().get_object(serial);
if (!obj) {
DebugConsole::write
- (str(format("No Map_Object with serial number %1%") % serial));
+ (str(format("No MapObject with serial number %1%") % serial));
return;
}
=== modified file 'src/wui/productionsitewindow.cc'
--- src/wui/productionsitewindow.cc 2014-07-25 13:45:18 +0000
+++ src/wui/productionsitewindow.cc 2014-07-28 18:15:26 +0000
@@ -190,7 +190,7 @@
er.set_string(2, "---");
}
} else if (request) {
- const Widelands::Worker_Descr * desc =
+ const Widelands::WorkerDescr * desc =
productionsite().descr().tribe().get_worker_descr(request->get_index());
er.set_picture
(0, desc->icon(),
=== modified file 'src/wui/transport_ui.cc'
--- src/wui/transport_ui.cc 2014-07-25 13:45:18 +0000
+++ src/wui/transport_ui.cc 2014-07-28 18:15:26 +0000
@@ -38,7 +38,7 @@
using Widelands::Game;
using Widelands::WareDescr;
using Widelands::Ware_Index;
-using Widelands::Worker_Descr;
+using Widelands::WorkerDescr;
static const char pic_tab_wares[] = "pics/menu_tab_wares.png";
Follow ups