Mercurial > parpg-core
changeset 87:b764229a0fad
Added ChangeMap component.
author | KarstenBock@gmx.net |
---|---|
date | Sun, 18 Sep 2011 16:07:07 +0200 |
parents | 2e307c4f78e3 |
children | d89e88a90c9e |
files | src/parpg/components/__init__.py src/parpg/components/change_map.py src/parpg/world.py |
diffstat | 3 files changed, 24 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parpg/components/__init__.py Fri Sep 09 16:12:46 2011 +0200 +++ b/src/parpg/components/__init__.py Sun Sep 18 16:07:07 2011 +0200 @@ -7,4 +7,4 @@ from fifeagent import FifeAgent from lockable import Lockable from usable import Usable - \ No newline at end of file +from change_map import ChangeMap \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parpg/components/change_map.py Sun Sep 18 16:07:07 2011 +0200 @@ -0,0 +1,22 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from bGrease.component import Component +from bGrease.geometry import Vec2d + +class ChangeMap(Component): + """Component that allows an entity to be contained by Container entity.""" + + def __init__(self): + """Constructor""" + Component.__init__(self, target_map=str, target_position=list) \ No newline at end of file
--- a/src/parpg/world.py Fri Sep 09 16:12:46 2011 +0200 +++ b/src/parpg/world.py Sun Sep 18 16:07:07 2011 +0200 @@ -20,9 +20,7 @@ self.components.fifeagent = components.FifeAgent() self.components.lockable = components.Lockable() self.components.usable = components.Usable() - - #WORKAROUND: To get rid of exception in gamescenecontroller - self.components.change_map = Component() + self.components.change_map = components.ChangeMap() def pump(self, dt): for component in self.components: