Projekt_AI-Automatyczny_saper/Engine/Bomb.py

41 lines
1.2 KiB
Python

class Bomb:
def __init__(self, detonationDuration, bombType, detonationArea, size, isDefusable):
self.detonationDuration = detonationDuration
self.bombType = bombType
self.isDefusable = isDefusable
self.detonationArea = detonationArea
self.size = size
self.isDefused = False
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