Package horizons :: Package component :: Module fieldbuilder :: Class FieldBuilder
[hide private]
[frames] | no frames]

Class FieldBuilder

source code

Component --+

Component for production buildings. It adds a hook `fill_range` to fill the
building range with a specified 1x1 field. The usual buildability constraints
for that field apply. `fill_range` will only succeed if the cost for filling
the entire range can be paid - there is no automated partial construction.
For GUI purposes, some more information is exposed:
- how many fields would be built at once
- total resource cost
- whether the build is affordable right now.

Instance Methods [hide private]
__init__(self, field)
Used for initialization code that does not require any other components.
source code
how_many(self) source code
total_cost(self) source code
check_resources(self) source code
coords_in_range(self) source code
fill_range(self) source code
    Inherited from Component
__gt__(self, other) source code
__lt__(self, other) source code
This is called by the ComponentHolder after it set the instance.
source code
load(self, db, worldid)
This does on load what __init() and initalize() together do on constructions at runtime.
source code
Removes component and reference to instance
source code
save(self, db)
Will do nothing, but will be always called in componentholder code, even if not implemented.
source code
Class Methods [hide private]
    Inherited from Component
get_instance(cls, arguments=None)
This function is used to instantiate classes from yaml data.
source code
Class Variables [hide private]
  NAME = 'FieldBuilder'
    Inherited from Component
Properties [hide private]
    Inherited from Component
Method Details [hide private]

__init__(self, field)

source code 

Used for initialization code that does not require any other components. This is always called first, on construction and on load.

Overrides: Component.__init__
(inherited documentation)


source code 
  • @property


source code 
  • @property