annotate src/parpg/objects/components.py @ 33:32d8b4dd9d99

Added basic components
author KarstenBock@gmx.net
date Mon, 25 Jul 2011 13:39:01 +0200
parents
children
rev   line source
33
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
1 # This file is part of PARPG.
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
2
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
3 # PARPG is free software: you can redistribute it and/or modify
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
5 # the Free Software Foundation, either version 3 of the License, or
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
6 # (at your option) any later version.
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
7
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
8 # PARPG is distributed in the hope that it will be useful,
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
11 # GNU General Public License for more details.
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
12
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
15
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
16 from parpg.grease.component import Component
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
17 from parpg.grease.geometry import Vec2d
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
18
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
19 """ Contains the components for PARPG
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
20 """
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
21
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
22 class FifeAgent(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
23 """Component that stores the values for a fife agent"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
24
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
25 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
26 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
27 Component.__init__(identifier=int, layer=object, behaviour=object, gfx=str)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
28
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
29 class Description(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
30 """Component that stores the description of an object"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
31
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
32 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
33 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
34 Component.__init__(view_name=str, real_name=str, desc=str)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
35
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
36 class Statistics(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
37 """Component that stores statistics"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
38
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
39 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
40 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
41 Component.__init__(statistics=object)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
42
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
43 class Dialogue(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
44 """Component that stores the dialogue"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
45
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
46 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
47 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
48 Component.__init__(dialogue=object)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
49
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
50 class Inventory(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
51 """Component that stores the inventory"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
52
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
53 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
54 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
55 Component.__init__(inventory=object, hidden=bool)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
56
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
57 class Lock(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
58 """Component that stores the data of a lock"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
59
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
60 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
61 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
62 Component.__init__(open=bool, locked=bool)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
63
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
64 class Item(Component):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
65 """Component that stores the data of an item"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
66
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
67 def __init__(self):
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
68 """Constructor"""
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
69 Component.__init__(bulk=int, weight=int, image=str, container=object)
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
70
32d8b4dd9d99 Added basic components
KarstenBock@gmx.net
parents:
diff changeset
71