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