|
Pol
Revision:cb584c9
|
#include <resource.h>
Inheritance diagram for Pol::Core::ResourceDef:Public Member Functions | |
| ResourceDef (const char *name) | |
| void | consume (unsigned amount) |
| void | counttiles () |
| virtual size_t | estimateSize () const POL_OVERRIDE |
| bool | findmarker (xcoord x, ycoord y, Realms::Realm *realm, unsigned int objtype) |
| void | produce (unsigned amount) |
| void | read_config (Clib::ConfigElem &elem) |
| void | read_data (Clib::ConfigElem &elem) |
| void | regenerate (time_t now) |
| void | write (Clib::StreamWriter &sw) const |
Public Member Functions inherited from Pol::Core::RegionGroup< ResourceRegion > | |
| RegionGroup (const char *name) | |
| virtual ResourceRegion * | getregion (xcoord x, ycoord y, Realms::Realm *realm) |
| virtual ResourceRegion * | getregion (const std::string ®ionname) |
Public Member Functions inherited from Pol::Core::RegionGroupBase | |
| RegionGroupBase (const char *name) | |
| virtual | ~RegionGroupBase () |
| void | create_bgnd_region (Clib::ConfigElem &elem) |
| const std::string & | name () const |
| void | read_region (Clib::ConfigElem &elem) |
Private Attributes | |
| int | current_units_ |
| unsigned int | initial_units_ |
| std::set< unsigned short > | landtiles_ |
| std::set< unsigned short > | tiles_ |
Additional Inherited Members | |
Protected Types inherited from Pol::Core::RegionGroupBase | |
| typedef std::map< Realms::Realm *, RegionId ** > | RegionRealms |
Protected Member Functions inherited from Pol::Core::RegionGroup< ResourceRegion > | |
| virtual Region * | create_region (Clib::ConfigElem &elem, RegionId id) const POL_OVERRIDE |
Protected Member Functions inherited from Pol::Core::RegionGroupBase | |
| Region * | getregion_byloc (xcoord x, ycoord y, Realms::Realm *realm) |
| Region * | getregion_byname (const std::string ®ionname) |
Protected Attributes inherited from Pol::Core::RegionGroupBase | |
| RegionRealms | regionrealms |
| std::vector< Region * > | regions_ |
Definition at line 100 of file resource.h.
|
explicit |
Definition at line 141 of file resource.cpp.
Referenced by Pol::Core::read_resource_cfg().
| void Pol::Core::ResourceDef::consume | ( | unsigned | amount | ) |
Definition at line 228 of file resource.cpp.
References current_units_.
| void Pol::Core::ResourceDef::counttiles | ( | ) |
Definition at line 188 of file resource.cpp.
References Pol::Core::gamestate, Pol::Core::RegionGroup< ResourceRegion >::getregion(), Pol::Plib::MAPTILE_CELL::landtile, landtiles_, Pol::Core::RegionGroupBase::name(), POLLOG_INFO, Pol::Core::GameState::Realms, Pol::Core::RegionGroupBase::regions_, and Pol::Core::ResourceRegion::tilecount_.
|
virtual |
Reimplemented from Pol::Core::RegionGroupBase.
Definition at line 445 of file resource.cpp.
References Pol::Core::RegionGroupBase::estimateSize(), landtiles_, and tiles_.
| bool Pol::Core::ResourceDef::findmarker | ( | xcoord | x, |
| ycoord | y, | ||
| Realms::Realm * | realm, | ||
| unsigned int | objtype | ||
| ) |
Definition at line 170 of file resource.cpp.
References Pol::Realms::Realm::findstatic(), Pol::Items::getgraphic(), Pol::Realms::Realm::getmaptile(), Pol::Plib::MAPTILE_CELL::landtile, landtiles_, and tiles_.
Referenced by Pol::Core::get_harvest_difficulty().
| void Pol::Core::ResourceDef::produce | ( | unsigned | amount | ) |
Definition at line 233 of file resource.cpp.
References current_units_.
| void Pol::Core::ResourceDef::read_config | ( | Clib::ConfigElem & | elem | ) |
Definition at line 146 of file resource.cpp.
References current_units_, initial_units_, landtiles_, Pol::Clib::ConfigElem::remove_prop(), Pol::Clib::ConfigElem::remove_ulong(), and tiles_.
| void Pol::Core::ResourceDef::read_data | ( | Clib::ConfigElem & | elem | ) |
Definition at line 165 of file resource.cpp.
References current_units_, and Pol::Clib::ConfigElem::remove_ulong().
Referenced by Pol::Core::read_global_data().
| void Pol::Core::ResourceDef::regenerate | ( | time_t | now | ) |
Definition at line 219 of file resource.cpp.
References Pol::Core::ResourceRegion::regenerate(), and Pol::Core::RegionGroupBase::regions_.
| void Pol::Core::ResourceDef::write | ( | Clib::StreamWriter & | sw | ) | const |
Definition at line 430 of file resource.cpp.
References current_units_, Pol::Core::RegionGroupBase::name(), Pol::Core::RegionGroupBase::regions_, and Pol::Core::ResourceRegion::write().
|
private |
Definition at line 119 of file resource.h.
Referenced by consume(), produce(), read_config(), read_data(), and write().
|
private |
Definition at line 118 of file resource.h.
Referenced by read_config().
|
private |
Definition at line 120 of file resource.h.
Referenced by counttiles(), estimateSize(), findmarker(), and read_config().
|
private |
Definition at line 121 of file resource.h.
Referenced by estimateSize(), findmarker(), and read_config().