|
|
@@ -1,59 +1,61 @@
|
|
|
"""EntityTypes module: contains classes that describe Entity types"""
|
|
|
|
|
|
+from SpecImports import *
|
|
|
+
|
|
|
class Entity:
|
|
|
attribs = (
|
|
|
- 'type',
|
|
|
- 'name',
|
|
|
- 'comment',
|
|
|
+ ('type', None),
|
|
|
+ ('name', 'unnamed'),
|
|
|
+ ('comment', ''),
|
|
|
)
|
|
|
|
|
|
class LevelMgr(Entity):
|
|
|
- name = 'levelMgr'
|
|
|
+ type = 'levelMgr'
|
|
|
attribs = (
|
|
|
- 'cogLevel',
|
|
|
- 'cogTrack',
|
|
|
- 'modelFilename',
|
|
|
+ ('cogLevel', 0),
|
|
|
+ ('cogTrack', 'c'),
|
|
|
+ ('modelFilename', None),
|
|
|
)
|
|
|
|
|
|
class LogicGate(Entity):
|
|
|
- name = 'logicGate'
|
|
|
+ type = 'logicGate'
|
|
|
attribs = (
|
|
|
- 'input_input1_bool',
|
|
|
- 'input_input2_bool',
|
|
|
- 'isInput1',
|
|
|
- 'isInput2',
|
|
|
- 'logicType',
|
|
|
- 'output',
|
|
|
+ ('input_input1_bool', 0),
|
|
|
+ ('input_input2_bool', 0),
|
|
|
+ ('isInput1', 0),
|
|
|
+ ('isInput2', 0),
|
|
|
+ ('logicType', 'or'),
|
|
|
+ ('output', 'bool'),
|
|
|
)
|
|
|
|
|
|
class NodepathImpl:
|
|
|
attribs = (
|
|
|
- 'parent',
|
|
|
- 'pos',
|
|
|
- 'hpr',
|
|
|
+ ('parent', 0),
|
|
|
+ ('pos', Point3(0,0,0)),
|
|
|
+ ('hpr', Vec3(0,0,0)),
|
|
|
)
|
|
|
|
|
|
# Note: this covers Nodepath and DistributedNodepath
|
|
|
class Nodepath(Entity, NodepathImpl):
|
|
|
- name = 'nodepath'
|
|
|
+ type = 'nodepath'
|
|
|
|
|
|
class NodepathAttribs:
|
|
|
attribs = (
|
|
|
- 'parent',
|
|
|
- 'pos',
|
|
|
- 'hpr',
|
|
|
+ ('parent', 0),
|
|
|
+ ('pos', Point3(0,0,0)),
|
|
|
+ ('hpr', Vec3(0,0,0)),
|
|
|
)
|
|
|
|
|
|
class Zone(Entity, NodepathAttribs):
|
|
|
- name = 'zone'
|
|
|
+ type = 'zone'
|
|
|
delAttribs = (
|
|
|
'parent',
|
|
|
'pos',
|
|
|
'hpr',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'description',
|
|
|
- 'modelZoneNum',
|
|
|
+ ('description', ''),
|
|
|
+ ('modelZoneNum', None),
|
|
|
)
|
|
|
|
|
|
class BarrelBase(Nodepath):
|
|
|
@@ -61,148 +63,148 @@ class BarrelBase(Nodepath):
|
|
|
'hpr',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'h',
|
|
|
+ ('h', 0),
|
|
|
)
|
|
|
|
|
|
class BeanBarrel(BarrelBase):
|
|
|
- name = 'beanBarrel'
|
|
|
+ type = 'beanBarrel'
|
|
|
|
|
|
class GagBarrel(BarrelBase):
|
|
|
- name = 'gagBarrel'
|
|
|
+ type = 'gagBarrel'
|
|
|
attribs = (
|
|
|
- 'gagLevel',
|
|
|
- 'gagTrack',
|
|
|
+ ('gagLevel', 0),
|
|
|
+ ('gagTrack', 0),
|
|
|
)
|
|
|
|
|
|
class Switch(Entity, NodepathImpl):
|
|
|
attribs = (
|
|
|
- 'scale',
|
|
|
- 'color',
|
|
|
- 'model',
|
|
|
- 'input_isOn_bool',
|
|
|
- 'isOn',
|
|
|
- 'output',
|
|
|
- 'secondsOn',
|
|
|
+ ('scale', 1),
|
|
|
+ ('color', Vec4(1,1,1,1)),
|
|
|
+ ('model', None),
|
|
|
+ ('input_isOn_bool', 0),
|
|
|
+ ('isOn', 0),
|
|
|
+ ('output', 'bool'),
|
|
|
+ ('secondsOn', 1),
|
|
|
)
|
|
|
|
|
|
class Button(Switch):
|
|
|
- name = 'button'
|
|
|
+ type = 'button'
|
|
|
|
|
|
class Trigger(Switch):
|
|
|
- name = 'trigger'
|
|
|
+ type = 'trigger'
|
|
|
|
|
|
class Crate(Nodepath):
|
|
|
- name = 'crate'
|
|
|
+ type = 'crate'
|
|
|
delAttribs = (
|
|
|
'hpr',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'scale',
|
|
|
- 'gridId',
|
|
|
- 'pushable',
|
|
|
+ ('scale', 1),
|
|
|
+ ('gridId', None),
|
|
|
+ ('pushable', 1),
|
|
|
)
|
|
|
|
|
|
class Door(Entity):
|
|
|
- name = 'door'
|
|
|
- attribs = (
|
|
|
- 'parent',
|
|
|
- 'pos',
|
|
|
- 'hpr',
|
|
|
- 'scale',
|
|
|
- 'color',
|
|
|
- 'model',
|
|
|
- 'doorwayNum',
|
|
|
- 'input_Lock0_bool',
|
|
|
- 'input_Lock1_bool',
|
|
|
- 'input_Lock2_bool',
|
|
|
- 'input_Lock3_bool',
|
|
|
- 'input_isOpen_bool',
|
|
|
- 'isLock0Unlocked',
|
|
|
- 'isLock1Unlocked',
|
|
|
- 'isLock2Unlocked',
|
|
|
- 'isLock3Unlocked',
|
|
|
- 'isOpen',
|
|
|
- 'output',
|
|
|
- 'secondsOpen',
|
|
|
+ type = 'door'
|
|
|
+ attribs = (
|
|
|
+ ('parent', 0),
|
|
|
+ ('pos', Point3(0,0,0)),
|
|
|
+ ('hpr', Vec3(0,0,0)),
|
|
|
+ ('scale', 1),
|
|
|
+ ('color', Vec4(1,1,1,1)),
|
|
|
+ ('model', None),
|
|
|
+ ('doorwayNum', 0),
|
|
|
+ ('input_Lock0_bool', 0),
|
|
|
+ ('input_Lock1_bool', 0),
|
|
|
+ ('input_Lock2_bool', 0),
|
|
|
+ ('input_Lock3_bool', 0),
|
|
|
+ ('input_isOpen_bool', 0),
|
|
|
+ ('isLock0Unlocked', 0),
|
|
|
+ ('isLock1Unlocked', 0),
|
|
|
+ ('isLock2Unlocked', 0),
|
|
|
+ ('isLock3Unlocked', 0),
|
|
|
+ ('isOpen', 0),
|
|
|
+ ('output', 'bool'),
|
|
|
+ ('secondsOpen', 1),
|
|
|
)
|
|
|
|
|
|
class Grid(Nodepath):
|
|
|
- name = 'grid'
|
|
|
+ type = 'grid'
|
|
|
delAttribs = (
|
|
|
'hpr',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'cellSize',
|
|
|
- 'numCol',
|
|
|
- 'numRow',
|
|
|
+ ('cellSize', 3),
|
|
|
+ ('numCol', 3),
|
|
|
+ ('numRow', 3),
|
|
|
)
|
|
|
|
|
|
class Lift(Nodepath):
|
|
|
- name = 'lift'
|
|
|
+ type = 'lift'
|
|
|
attribs = (
|
|
|
- 'duration',
|
|
|
- 'startPos',
|
|
|
- 'endPos',
|
|
|
- 'modelPath',
|
|
|
- 'floorName',
|
|
|
- 'modelScale',
|
|
|
+ ('duration', 1),
|
|
|
+ ('startPos', Point3(0,0,0)),
|
|
|
+ ('endPos', Point3(0,0,0)),
|
|
|
+ ('modelPath', ''),
|
|
|
+ ('floorName', ''),
|
|
|
+ ('modelScale', 1),
|
|
|
)
|
|
|
|
|
|
class Platform(Nodepath):
|
|
|
- name = 'platform'
|
|
|
+ type = 'platform'
|
|
|
delAttribs = (
|
|
|
'pos',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'startPos',
|
|
|
- 'endPos',
|
|
|
- 'speed',
|
|
|
- 'waitDur',
|
|
|
- 'phaseShift',
|
|
|
+ ('startPos', Point3(0,0,0)),
|
|
|
+ ('endPos', Point3(0,0,0)),
|
|
|
+ ('speed', 1),
|
|
|
+ ('waitDur', 1),
|
|
|
+ ('phaseShift', 0.),
|
|
|
)
|
|
|
|
|
|
class SinkingPlatform(Nodepath):
|
|
|
- name = 'sinkingPlatform'
|
|
|
+ type = 'sinkingPlatform'
|
|
|
delAttribs = (
|
|
|
'pos',
|
|
|
)
|
|
|
attribs = (
|
|
|
- 'endPos',
|
|
|
- 'phaseShift',
|
|
|
- 'startPos',
|
|
|
- 'verticalRange',
|
|
|
- 'sinkRate',
|
|
|
- 'riseRate',
|
|
|
- 'speed',
|
|
|
- 'waitDur',
|
|
|
+ ('endPos', Point3(0,0,0)),
|
|
|
+ ('phaseShift', 0.),
|
|
|
+ ('startPos', Point3(0,0,0)),
|
|
|
+ ('verticalRange', 1),
|
|
|
+ ('sinkRate', 1),
|
|
|
+ ('riseRate', 1),
|
|
|
+ ('speed', 1),
|
|
|
+ ('waitDur', 1),
|
|
|
)
|
|
|
|
|
|
class Stomper(Nodepath):
|
|
|
- name = 'stomper'
|
|
|
+ type = 'stomper'
|
|
|
attribs = (
|
|
|
- 'headScale',
|
|
|
- 'motion',
|
|
|
- 'period',
|
|
|
- 'phaseShift',
|
|
|
- 'range',
|
|
|
- 'shaftScale',
|
|
|
- 'soundLen',
|
|
|
- 'soundOn',
|
|
|
- 'style',
|
|
|
- 'zOffset',
|
|
|
+ ('headScale', Vec3(1,1,1)),
|
|
|
+ ('motion', 3),
|
|
|
+ ('period', 2.),
|
|
|
+ ('phaseShift', 0.),
|
|
|
+ ('range', 6),
|
|
|
+ ('shaftScale', Vec3(1,1,1)),
|
|
|
+ ('soundLen', 0),
|
|
|
+ ('soundOn', 0),
|
|
|
+ ('style', 'horizontal'),
|
|
|
+ ('zOffset', 0),
|
|
|
)
|
|
|
|
|
|
class StomperPair(Nodepath):
|
|
|
- name = 'stomperPair'
|
|
|
- attribs = (
|
|
|
- 'headScale',
|
|
|
- 'motion',
|
|
|
- 'period',
|
|
|
- 'phaseShift',
|
|
|
- 'range',
|
|
|
- 'shaftScale',
|
|
|
- 'soundLen',
|
|
|
- 'soundOn',
|
|
|
- 'stomperIds',
|
|
|
- 'style',
|
|
|
+ type = 'stomperPair'
|
|
|
+ attribs = (
|
|
|
+ ('headScale', Vec3(1,1,1)),
|
|
|
+ ('motion', 3),
|
|
|
+ ('period', 2.),
|
|
|
+ ('phaseShift', 0.),
|
|
|
+ ('range', 6),
|
|
|
+ ('shaftScale', Vec3(1,1,1)),
|
|
|
+ ('soundLen', 0),
|
|
|
+ ('soundOn', 0),
|
|
|
+ ('stomperIds', []),
|
|
|
+ ('style', 'horizontal'),
|
|
|
)
|