Projekt_AI-Automatyczny_saper/Engine/BombFactory.py

19 lines
579 B
Python
Raw Normal View History

2021-03-27 22:07:55 +01:00
from Constants import DECOY, ATOMIC_BOMB, CHEMICAL_BOMB, CLAYMORE, LAND_MINE
from Engine.Bomb import Bomb
2021-03-30 21:01:54 +02:00
2021-03-27 22:07:55 +01:00
class BombFactory:
@staticmethod
def create(bombType):
if bombType == DECOY:
return Bomb(float('inf'), float('inf'), DECOY)
elif bombType == ATOMIC_BOMB:
2021-03-30 21:01:54 +02:00
return Bomb(2, 2, ATOMIC_BOMB)
2021-03-27 22:07:55 +01:00
elif bombType == CHEMICAL_BOMB:
2021-03-30 21:01:54 +02:00
return Bomb(2, 3, CHEMICAL_BOMB)
2021-03-27 22:07:55 +01:00
elif bombType == CLAYMORE:
2021-03-30 21:01:54 +02:00
return Bomb(2, 4, CLAYMORE)
2021-03-27 22:07:55 +01:00
elif bombType == LAND_MINE:
2021-03-30 21:01:54 +02:00
return Bomb(3, 4, LAND_MINE)