Mercurial > parpg-source
comparison 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 |
comparison
equal
deleted
inserted
replaced
186:c41299c7e833 | 187:ab6a0fd1668a |
---|---|
72 engine, | 72 engine, |
73 view, | 73 view, |
74 model, | 74 model, |
75 application) | 75 application) |
76 World.__init__(self) | 76 World.__init__(self) |
77 | |
78 #setup functions for the GameEnvironment | |
79 createItemByID = lambda identifier : ( | |
80 self.model.createItemByID( | |
81 identifier=identifier, | |
82 world=self) | |
83 ) | |
84 createItemByType = lambda item_type, identifier: ( | |
85 self.model.createItemByType( | |
86 item_type=item_type, | |
87 identifier=identifier, | |
88 world=self) | |
89 ) | |
90 funcs = { | |
91 "createItemByID": createItemByID, | |
92 "createItemByType": createItemByType, | |
93 } | |
94 self.model.game_state.funcs.update(funcs) | |
77 self.systems.scripting.game_state = self.model.game_state | 95 self.systems.scripting.game_state = self.model.game_state |
78 | 96 |
79 #this can be helpful for IDEs code analysis | 97 #this can be helpful for IDEs code analysis |
80 if False: | 98 if False: |
81 assert(isinstance(self.engine, fife.Engine)) | 99 assert(isinstance(self.engine, fife.Engine)) |