Mercurial > parpg-core
changeset 103:65aa498791ed
The addObject method of the GameState class now accepts an object_id parameter, instead of it getting that value from the object.
author | KarstenBock@gmx.net |
---|---|
date | Thu, 22 Sep 2011 14:29:28 +0200 |
parents | 334f7aea6386 |
children | de741e83a422 |
files | src/parpg/gamestate.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parpg/gamestate.py Wed Sep 21 19:52:35 2011 +0200 +++ b/src/parpg/gamestate.py Thu Sep 22 14:29:28 2011 +0200 @@ -28,16 +28,17 @@ self.npcs_met = set() - def addObject(self, map_id, game_object): + def addObject(self, object_id, map_id, game_object): """Adds an object to the objects and object_ids dictionaries. + @param object_id: ID of the object + @type object_id: str @param map_id: ID of the map the object is on. If the object is in a container this has to be None + @type map_id: str or None @param object: object to be added @type object: GameObject - @type map_id: str or None """ - object_id = game_object.fifeagent.identifier if not self.object_ids.has_key(object_id): if map_id: self.objects[map_id][object_id] = game_object