comparison gamemodel.py @ 107:100a39fa64a2

Added ExamineContentsAction. Added "Examine Contents" to the context menu, when the object is a container and does not have a characterstats component.
author KarstenBock@gmx.net
date Fri, 30 Sep 2011 15:31:53 +0200
parents edadf3ff8a9a
children 81b51b9d861e
comparison
equal deleted inserted replaced
106:edadf3ff8a9a 107:100a39fa64a2
305 305
306 def readAgentsOfMap(self, map_name): 306 def readAgentsOfMap(self, map_name):
307 """Read the agents of the map 307 """Read the agents of the map
308 @param map_name: Name of the map 308 @param map_name: Name of the map
309 @type map_name: str """ 309 @type map_name: str """
310 #Get the agents of the map 310 #Get the agents of the map
311 map_agents_file = self.map_files[map_name].\ 311 map_agents_file = self.map_files[map_name].\
312 replace(".xml", "_agents.yaml") 312 replace(".xml", "_agents.yaml")
313 agents_data = vfs.VFS.open(map_agents_file) 313 agents_data = vfs.VFS.open(map_agents_file)
314 agents = yaml.load_all(agents_data) 314 agents = yaml.load_all(agents_data)
315 self.agents[map_name] = {}
315 for agent in agents: 316 for agent in agents:
316 if not agent == None: 317 if not agent == None:
317 self.addAgent(map_name, agent) 318 self.addAgent(map_name, agent)
318 319
319 def readAllAgents(self): 320 def readAllAgents(self):