-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElement.py
34 lines (31 loc) · 1.05 KB
/
Element.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Element:
states = ['reseted','activated']
def __init__(self,
owner = 'everyone',
name = 'item',
number = 0,
points = 0,
zone = None):
self.owner = owner
self.state = 'reseted'
self.moveable = True
self.contains = []
self.upper_in_stack = None
self.base_points = points
self.name = 'item'
self.number = number
self.id = name + str(number)
self.start_zone = zone
self.current_zone = self.start_zone
def condition(self):
"""Condition to gain the item's points based on its state or
its current_zone at the end of the match"""
return True
def score(self):
"""return the actual score verifying the condition and managing a stack of elements"""
score = 0
if self.condition():
score += self.base_points
if self.upper_in_stack != None:
score += self.upper_in_stack.score()
return score