association_pouvoirs.gd 452 B

123456789101112131415161718192021
  1. class_name Pouvoir
  2. enum Type {
  3. AUCUN, # si pas de pouvoir, laisser en premier
  4. #RALENTIR,
  5. BONJOUR # laisser en dernier
  6. }
  7. static func fabriquer(type: Type): # -> PouvoirBase
  8. match type:
  9. Type.BONJOUR:
  10. return BonjourPouvoir.new()
  11. #Type.RALENTIR:
  12. #return RalentirPouvoir.new()
  13. Type.AUCUN:
  14. return null
  15. _:
  16. assert(false, "Le nouveau pouvoir doit etre associe a son type " + str(type))
  17. return null # sinon compilateur pas content