Package horizons :: Package world :: Package disaster :: Module disastermanager :: Class DisasterManager
[hide private]
[frames] | no frames]

Class DisasterManager

source code

The disaster manager manages disasters. It seeds them into the game world and makes all requirements for a disaster are met before seeding it.

Instance Methods [hide private]
 
__init__(self, session, disabled=False) source code
 
save(self, db) source code
 
load(self, db) source code
 
run(self) source code
 
end_disaster(self, settlement) source code
 
is_affected(self, settlement)
Returns whether there is currently a disaster in a settlement
source code
 
get_disaster(self, settlement)
Returns the currently active disaster for the given settlement.
source code
Class Variables [hide private]
  log = logging.getLogger("world.disaster")
  CALL_EVERY = GAME_SPEED.TICKS_PER_SECOND* 60
Method Details [hide private]

__init__(self, session, disabled=False)
(Constructor)

source code 
Parameters:
  • disabled - Don't do anything at all if True (but be responsive to normal calls)

get_disaster(self, settlement)

source code 

Returns the currently active disaster for the given settlement. None is returned in case no disaster is currently active.