123456789101112131415161718192021 |
- class_name Pouvoir
- enum Type {
- AUCUN, # si pas de pouvoir, laisser en premier
- #RALENTIR,
- BONJOUR # laisser en dernier
- }
- static func fabriquer(type: Type): # -> PouvoirBase
- match type:
- Type.BONJOUR:
- return BonjourPouvoir.new()
- #Type.RALENTIR:
- #return RalentirPouvoir.new()
- Type.AUCUN:
- return null
- _:
- assert(false, "Le nouveau pouvoir doit etre associe a son type " + str(type))
- return null # sinon compilateur pas content
|