Projekt_AI-Automatyczny_saper/Engine/BombFactory.py

19 lines
717 B
Python
Raw Normal View History

2021-05-18 00:21:14 +02:00
from Constants import DECOY, ATOMIC_BOMB, CHEMICAL_BOMB, CLAYMORE, LAND_MINE, NONE, LONG, SHORT, IMMEDIATE, YES, NO, LARGE, SMALL, MEDIUM
2021-03-27 22:07:55 +01:00
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:
2021-05-18 00:21:14 +02:00
return Bomb(NONE, DECOY, LARGE, SMALL, NO)
2021-03-27 22:07:55 +01:00
elif bombType == ATOMIC_BOMB:
2021-06-01 17:38:31 +02:00
return Bomb(LONG, ATOMIC_BOMB, LARGE, LARGE, YES)
2021-03-27 22:07:55 +01:00
elif bombType == CHEMICAL_BOMB:
2021-05-18 00:21:14 +02:00
return Bomb(SHORT, CHEMICAL_BOMB, SMALL, SMALL, NO)
2021-03-27 22:07:55 +01:00
elif bombType == CLAYMORE:
2021-06-01 17:38:31 +02:00
return Bomb(NONE, CLAYMORE, SMALL, MEDIUM, YES)
2021-03-27 22:07:55 +01:00
elif bombType == LAND_MINE:
2021-05-18 00:21:14 +02:00
return Bomb(IMMEDIATE, LAND_MINE, LARGE, LARGE, NO)