Mercurial > parpg-source
changeset 73:5c751b9a3d8b
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 | 783dc57eca7c |
children | c9818290bbe7 |
files | gamestate.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gamestate.py Wed Sep 21 19:51:37 2011 +0200 +++ b/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