Package horizons :: Package ai :: Package aiplayer :: Package building :: Module fisher :: Class AbstractFisher
[hide private]
[frames] | no frames]

Class AbstractFisher

source code

AbstractBuilding --+
                   |
                  AbstractFisher

Instance Methods [hide private]
 
get_production_level(self, building, resource_id)
Return the actual production capacity of a single building of this type producing the given resource.
source code
 
get_expected_cost(self, resource_id, production_needed, settlement_manager)
Return a value representing the utility cost of building enough buildings to produced the given amount of resource per tick.
source code
 
iter_potential_locations(self, settlement_manager)
Iterate over possible locations of the building in the given settlement in the form of (x, y, orientation).
source code
 
evaluator_class(self)
Return the relevant BuildingEvaluator subclass.
source code
    Inherited from AbstractBuilding
 
__init__(self, building_id, name, settler_level) source code
 
_get_producer_building(self) source code
 
build(self, settlement_manager, resource_id)
Try to build the best possible instance of this building in the given settlement.
source code
 
coverage_building(self)
Return a boolean showing whether buildings of this type may need to be built even when the production capacity has been reached.
source code
 
directly_buildable(self)
Return a boolean showing whether the build function of this subclass can be used to build a building of this type.
source code
 
get_evaluators(self, settlement_manager, resource_id)
Return a list of every BuildingEvaluator for this building type in the given settlement.
source code
 
get_expected_building_cost(self)
Return a value representing the utility cost of building the building.
source code
 
get_expected_production_level(self, resource_id)
Return the expected production capacity of a single building of this type producing the given resource.
source code
 
have_resources(self, settlement_manager)
Return a boolean showing whether the given settlement has enough resources to build a building of this type.
source code
 
ignore_production(self)
Return a boolean showing whether instances of this building can be used to calculate the production capacity.
source code
 
need_to_build_more_buildings(self, settlement_manager, resource_id)
Return a boolean showing whether another instance of the building should be built right now regardless of the production capacity.
source code
 
producer_building(self)
Return a boolean showing whether this building is supposed to have usable production lines.
source code
Class Methods [hide private]
 
register_buildings(cls) source code
    Inherited from AbstractBuilding
 
_get_buildability_intersection(cls, settlement_manager, size, terrain_type, need_collector_connection) source code
 
_load_name(cls, db, building_id) source code
 
_load_settler_level(cls, building_id) source code
 
load(cls, db, building_id) source code
 
load_all(cls, db)
Fill the cls.buildings dict so the registered buildings can be used.
source code
Class Variables [hide private]
    Inherited from AbstractBuilding
  _available_buildings = {}
  buildings = {}
  log = logging.getLogger("ai.aiplayer.building")
  monthly_gold_cost = 50
  resource_cost = {RES.GOLD: 1, RES.BOARDS: 20, RES.BRICKS: 45, ...
Method Details [hide private]

get_production_level(self, building, resource_id)

source code 

Return the actual production capacity of a single building of this type producing the given resource.

Overrides: AbstractBuilding.get_production_level
(inherited documentation)

get_expected_cost(self, resource_id, production_needed, settlement_manager)

source code 

Return a value representing the utility cost of building enough buildings to produced the given amount of resource per tick.

Overrides: AbstractBuilding.get_expected_cost
(inherited documentation)

iter_potential_locations(self, settlement_manager)

source code 

Iterate over possible locations of the building in the given settlement in the form of (x, y, orientation).

Overrides: AbstractBuilding.iter_potential_locations
(inherited documentation)

evaluator_class(self)

source code 

Return the relevant BuildingEvaluator subclass.

Decorators:
  • @property
Overrides: AbstractBuilding.evaluator_class
(inherited documentation)