Mercurial > parpg-source
diff gamescenecontroller.py @ 187:ab6a0fd1668a
Added help, moveObject, deleteObject, putItemIntoContainer, equipItem, createItemByID and createItemByType functions to the GameEnvironment.
author | Beliar <KarstenBock@gmx.net> |
---|---|
date | Sat, 24 Mar 2012 09:59:46 +0100 |
parents | 62aed6388159 |
children | 2a12e2843984 |
line wrap: on
line diff
--- a/gamescenecontroller.py Tue Mar 20 14:31:02 2012 +0100 +++ b/gamescenecontroller.py Sat Mar 24 09:59:46 2012 +0100 @@ -74,6 +74,24 @@ model, application) World.__init__(self) + + #setup functions for the GameEnvironment + createItemByID = lambda identifier : ( + self.model.createItemByID( + identifier=identifier, + world=self) + ) + createItemByType = lambda item_type, identifier: ( + self.model.createItemByType( + item_type=item_type, + identifier=identifier, + world=self) + ) + funcs = { + "createItemByID": createItemByID, + "createItemByType": createItemByType, + } + self.model.game_state.funcs.update(funcs) self.systems.scripting.game_state = self.model.game_state #this can be helpful for IDEs code analysis