Pol  Rev 533
ResourceDef Class Reference

#include <resource.h>

+ Inheritance diagram for ResourceDef:
+ Collaboration diagram for ResourceDef:

List of all members.

Public Member Functions

 ResourceDef (const char *name)
void consume (unsigned amount)
void counttiles ()
bool findmarker (xcoord x, ycoord y, Realm *realm, unsigned int objtype)
void produce (unsigned amount)
void read_config (ConfigElem &elem)
void read_data (ConfigElem &elem)
void regenerate (time_t now)
void write (std::ostream &os) const

Private Attributes

int current_units_
unsigned int initial_units_
std::set< unsigned short > landtiles_
std::set< unsigned short > tiles_

Detailed Description

Definition at line 80 of file resource.h.


Constructor & Destructor Documentation

ResourceDef::ResourceDef ( const char *  name) [explicit]

Definition at line 148 of file resource.cpp.


Member Function Documentation

void ResourceDef::consume ( unsigned  amount)

Definition at line 238 of file resource.cpp.

References current_units_.

Referenced by remove_resources().

+ Here is the caller graph for this function:

bool ResourceDef::findmarker ( xcoord  x,
ycoord  y,
Realm realm,
unsigned int  objtype 
)

Definition at line 179 of file resource.cpp.

References Realm::findstatic(), getgraphic(), Realm::getmaptile(), MAPTILE_CELL::landtile, landtiles_, and tiles_.

Referenced by get_harvest_difficulty().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ResourceDef::produce ( unsigned  amount)

Definition at line 243 of file resource.cpp.

References current_units_.

Referenced by return_resources().

+ Here is the caller graph for this function:

Definition at line 155 of file resource.cpp.

References current_units_, initial_units_, landtiles_, ConfigElem::remove_prop(), ConfigElem::remove_ulong(), and tiles_.

Referenced by read_resource_cfg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 174 of file resource.cpp.

References current_units_, and ConfigElem::remove_ulong().

Referenced by read_global_data().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ResourceDef::regenerate ( time_t  now)

Definition at line 229 of file resource.cpp.

References ResourceRegion::regenerate(), and RegionGroupBase::regions_.

+ Here is the call graph for this function:

void ResourceDef::write ( std::ostream &  os) const

Definition at line 445 of file resource.cpp.

References current_units_, RegionGroupBase::name(), RegionGroupBase::regions_, and ResourceRegion::write().

+ Here is the call graph for this function:


Member Data Documentation

Definition at line 98 of file resource.h.

Referenced by consume(), produce(), read_config(), read_data(), and write().

unsigned int ResourceDef::initial_units_ [private]

Definition at line 97 of file resource.h.

Referenced by read_config().

std::set<unsigned short> ResourceDef::landtiles_ [private]

Definition at line 99 of file resource.h.

Referenced by counttiles(), findmarker(), and read_config().

std::set<unsigned short> ResourceDef::tiles_ [private]

Definition at line 100 of file resource.h.

Referenced by findmarker(), and read_config().


The documentation for this class was generated from the following files: