Package horizons :: Package util :: Package loaders :: Module loader :: Class GeneralLoader
[hide private]
[frames] | no frames]

Class GeneralLoader

source code

The ActionSetLoader loads action sets from a directory tree. The directories loaded begin with 'as_' to tell tell the loader that they are an action set. directory structure is as follows: <action_set>/<action>/<rotation>/<framenumber>.png for example that would be: fisher1/work/90/0.png Note that all directories except for the rotation dir, all dirs have to be empty and must not include additional action sets.

Class Methods [hide private]
 
_load_files(cls, directory, time)
Loads the files for a specific rotation
source code
 
_load_rotation(cls, directory)
Loads the rotations + files for a specific action
source code
 
_load_action(cls, directory)
Loads the actions + rotations + files for a specific action
source code
 
_load_mirrored_roads(cls, base_action, existing_files) source code
 
_rotate_roads(cls, action)
Rotate around 'abcd' and 'efgh' like this: >>> G = GeneralLoader() >>> G._rotate_roads('a') 'b' >>> G._rotate_roads('bd') 'ac' >>> G._rotate_roads('acde') 'abdf' >>> G._rotate_roads('abdf') 'abcg'
source code
 
_action_set_directories(cls, directory)
Returns directories that are important for loading action sets.
source code
Class Variables [hide private]
  log = logging.getLogger("util.loaders.loader")
Method Details [hide private]

_load_files(cls, directory, time)
Class Method

source code 

Loads the files for a specific rotation

Parameters:
  • directory - directory to load files from. Example: 'content/gfx/units/lumberjack/'
Returns:
dict of 'file: anim_end' items

_load_rotation(cls, directory)
Class Method

source code 

Loads the rotations + files for a specific action

Parameters:
  • directory - directory to load files from. Example: 'content/gfx/units/lumberjack/'
Returns:
dict of 'rotation: filedict' items. See _load_files for example.

_load_action(cls, directory)
Class Method

source code 

Loads the actions + rotations + files for a specific action

Parameters:
  • directory - directory to load files from. Example: 'content/gfx/units/lumberjack/'
Returns:
dict of 'action: rotationdict' items. See _load_rotation for example.

_action_set_directories(cls, directory)
Class Method

source code 

Returns directories that are important for loading action sets. Discards everything else that we found living there in the past.