Package horizons :: Package ai :: Package aiplayer :: Module settlementfounder :: Class SettlementFounder
[hide private]
[frames] | no frames]

Class SettlementFounder

source code

This class handles the settlement founding activities of an AI player.

Instance Methods [hide private]
 
__init__(self, owner) source code
 
_evaluate_island(self, island)
Return (flat land, utility value) of the given island.
source code
 
_get_available_islands(self, min_land)
Return a list of available islands in the form [(value, island), ...].
source code
 
_choose_island(self, min_land)
Randomly choose one of the big enough islands.
source code
 
_found_settlement(self, island, ship, feeder_island)
Found a settlement on the given island using the given ship.
source code
 
_have_settlement_starting_resources(self, ship, settlement, min_money, min_resources)
Returns a boolean showing whether we have enough resources to found a new settlement.
source code
 
have_starting_resources(self, ship, settlement)
Returns a boolean showing whether we have enough resources to found a new normal settlement.
source code
 
have_feeder_island_starting_resources(self, ship, settlement)
Returns a boolean showing whether we have enough resources to found a new feeder island.
source code
 
_prepare_foundation_ship(self, settlement_manager, ship, feeder_island)
Start a mission to load the settlement foundation resources on the given ship from the specified settlement.
source code
 
_want_another_village(self)
Return a boolean showing whether we want to start another settlement with a village.
source code
 
tick(self)
Found a new settlement or prepare a foundation ship if possible and required.
source code
 
can_found_feeder_island(self)
Return a boolean showing whether there is an island that could be turned into a feeder island.
source code
 
found_feeder_island(self)
Call this function to let the player know that a new feeder island is needed.
source code
 
__str__(self) source code
Class Variables [hide private]
  log = logging.getLogger("ai.aiplayer.settlement_founder")
Method Details [hide private]

_choose_island(self, min_land)

source code 

Randomly choose one of the big enough islands. Return the island or None if it is impossible.