comparison src/parpg/gamemodel.py @ 186:8cc26e89398c

Moved code from CharacterCreationController to GameModel
author KarstenBock@gmx.net
date Sat, 05 Nov 2011 14:53:12 +0100
parents 59c9ce2b8351
children f612b4638744
comparison
equal deleted inserted replaced
185:756ce052ac85 186:8cc26e89398c
20 from copy import deepcopy 20 from copy import deepcopy
21 21
22 from fife import fife 22 from fife import fife
23 from fife.extensions.serializers.xmlobject import XMLObjectLoader 23 from fife.extensions.serializers.xmlobject import XMLObjectLoader
24 from parpg.bGrease.geometry import Vec2d 24 from parpg.bGrease.geometry import Vec2d
25 from serializers import XmlSerializer
25 26
26 from parpg import vfs 27 from parpg import vfs
27 from gamestate import GameState 28 from gamestate import GameState
28 from gamemap import GameMap 29 from gamemap import GameMap
29 from common.utils import locateFiles 30 from common.utils import locateFiles
93 settings.parpg.ObjectDatabaseFile]) 94 settings.parpg.ObjectDatabaseFile])
94 self.dialogue_directory = settings.parpg.DialoguesPath 95 self.dialogue_directory = settings.parpg.DialoguesPath
95 self.dialogues = {} 96 self.dialogues = {}
96 self.agent_import_files = {} 97 self.agent_import_files = {}
97 self.obj_loader = XMLObjectLoader(self.engine) 98 self.obj_loader = XMLObjectLoader(self.engine)
98 99 # FIXME M. George Hansen 2011-06-06: character stats scripts aren't
100 # finished, unfortunately.
101 #primary_stats_file = \
102 # vfs.VFS.open('character_scripts/primary_stats.xml')
103 #self.primary_stats = XmlSerializer.deserialize(primary_stats_file)
104 #secondary_stats_file = \
105 # vfs.VFS.open('character_scripts/secondary_stats.xml')
106 #self.secondary_stats = XmlSerializer.deserialize(secondary_stats_file)
107 self.primary_stats = []
108 self.secondary_stats = []
109
99 def checkAttributes(self, attributes, template): 110 def checkAttributes(self, attributes, template):
100 """Checks for attributes that where not given in the map file 111 """Checks for attributes that where not given in the map file
101 and fills them with values from the object database 112 and fills them with values from the object database
102 @param attributes: attributes to check 113 @param attributes: attributes to check
103 @type attributes: Dictionary 114 @type attributes: Dictionary