Package horizons :: Package util :: Module savegameaccessor :: Class SavegameAccessor
[hide private]
[frames] | no frames]

Class SavegameAccessor

source code

dbreader.DbReader --+
                    |
                   SavegameAccessor

SavegameAccessor is the class used for loading saved games.

Frequent select queries are preloaded for faster access.

Instance Methods [hide private]
 
__init__(self, game_identifier, is_map, options=None) source code
 
close(self)
Closes the db
source code
 
_load_building(self) source code
 
get_building_row(self, worldid)
Returns (x, y, location, rotation, level)
source code
 
get_building_location(self, worldid) source code
 
_load_settlement(self) source code
 
get_settlement_owner(self, worldid)
Returns the id of the owner of the settlement or None otherwise
source code
 
get_settlement_island(self, worldid) source code
 
_load_concrete_object(self) source code
 
get_concrete_object_data(self, worldid) source code
 
_load_production(self) source code
 
get_production_by_id_and_owner(self, id, ownerid) source code
 
get_production_line_id(self, production_worldid)
Returns the prod_line_id of the given production
source code
 
get_production_lines_by_owner(self, owner)
Returns the prod_line_id of the given production
source code
 
get_production_state_history(self, worldid, prod_id) source code
 
_load_storage(self) source code
 
get_storage_rowids_by_ownerid(self, ownerid)
Returns potentially empty list of worldids referencing storages
source code
 
_load_wildanimal(self) source code
 
get_wildanimal_row(self, worldid)
Returns (health, can_reproduce)
source code
 
_load_unit(self) source code
 
get_unit_owner(self, worldid) source code
 
_load_building_collector(self) source code
 
get_building_collectors_data(self, worldid)
Returns (id of the building collector's home or None otherwise, creation_tick)
source code
 
get_building_collector_job_history(self, worldid) source code
 
_load_production_line(self) source code
 
get_production_line_row(self, for_worldid) source code
 
_load_unit_path(self) source code
 
get_unit_path(self, worldid) source code
 
_load_storage_global_limit(self) source code
 
get_storage_global_limit(self, worldid) source code
 
_load_health(self) source code
 
get_health(self, owner) source code
 
_load_fish_data(self) source code
 
get_last_fish_usage_tick(self, worldid) source code
    Inherited from dbreader.DbReader
 
__call__(self, command, *args)
Executes a sql command.
source code
 
cached_query(self, command, *args)
Executes a sql command and saves its result in a dict.
source code
 
execute_many(self, command, parameters)
Executes a sql command for each sequence or mapping found in parameters.
source code
 
execute_script(self, script)
Executes a multiline script.
source code
Class Methods [hide private]
 
get_players_num(cls, savegamefile)
Return number of regular human and ai players
source code
 
get_hash(cls, savegamefile) source code
Method Details [hide private]

__init__(self, game_identifier, is_map, options=None)
(Constructor)

source code 
Parameters:
  • file - str containing the database file.
Overrides: dbreader.DbReader.__init__

close(self)

source code 

Closes the db

Overrides: dbreader.DbReader.close
(inherited documentation)