|
@@ -1,5 +1,5 @@
|
1
|
1
|
from synergine_xyz.SynergyObject import SynergyObject as XyzSynergyObject
|
2
|
|
-from intelligine.cst import TRANSPORTABLE
|
|
2
|
+from intelligine.cst import TRANSPORTABLE, CARRIED
|
3
|
3
|
|
4
|
4
|
|
5
|
5
|
class Transportable(XyzSynergyObject):
|
|
@@ -8,6 +8,7 @@ class Transportable(XyzSynergyObject):
|
8
|
8
|
super().__init__(collection, context)
|
9
|
9
|
self._carried_by = None
|
10
|
10
|
context.metas.states.add(self.get_id(), TRANSPORTABLE)
|
|
11
|
+ self._is_carried = False
|
11
|
12
|
|
12
|
13
|
def set_carried_by(self, obj):
|
13
|
14
|
if obj is not None:
|
|
@@ -28,4 +29,11 @@ class Transportable(XyzSynergyObject):
|
28
|
29
|
return self
|
29
|
30
|
|
30
|
31
|
def is_takable(self):
|
31
|
|
- return not self.is_carried()
|
|
32
|
+ return not self.is_carried()
|
|
33
|
+
|
|
34
|
+ def set_is_carried(self, is_carried, by_obj):
|
|
35
|
+ self._is_carried = bool(is_carried)
|
|
36
|
+ if self._is_carried:
|
|
37
|
+ self._context.metas.value.set(CARRIED, subject=by_obj.get_id(), value=self.get_id())
|
|
38
|
+ else:
|
|
39
|
+ self._context.metas.value.unset(CARRIED, subject=by_obj.get_id())
|