Projekt_AI-Automatyczny_saper/Engine/Bomb.py

41 lines
1.2 KiB
Python
Raw Normal View History

2021-03-27 22:07:55 +01:00
class Bomb:
2021-05-18 00:21:14 +02:00
def __init__(self, detonationDuration, bombType, detonationArea, size, isDefusable):
self.detonationDuration = detonationDuration
2021-03-27 22:07:55 +01:00
self.bombType = bombType
2021-05-18 00:21:14 +02:00
self.isDefusable = isDefusable
self.detonationArea = detonationArea
self.size = size
2021-03-30 21:01:54 +02:00
self.isDefused = False
2021-05-18 00:21:14 +02:00
def getBombType(self):
return self.bombType
def getDetonationDuration(self):
return self.detonationDuration
def getDefusable(self):
return self.isDefusable
def getSize(self):
return self.size
def getDetonationArea(self):
return self.detonationArea
def getMapping(self):
mapping = []
d = {'Atomic Bomb': 0, 'Claymore': 1, 'Land Mine': 2, 'Chemical Bomb': 3, 'Decoy': 4}
mapping.append(d.get(self.getBombType()))
d = {'immediate': 0, 'short': 1, 'long': 2, 'none': 3}
mapping.append(d.get(self.getDetonationDuration()))
d = {'small': 0, 'medium': 1, 'large': 2}
mapping.append(d.get(self.getSize()))
d = {'small': 0, 'large': 1}
mapping.append(d.get(self.getDetonationArea()))
d = {'no': 0, 'yes': 1}
mapping.append(d.get(self.getDefusable()))
return mapping