From fefcacef4b65399d9d3eece04ac2bdb2b19f7e37 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 28 Apr 2024 17:16:36 +0200 Subject: [PATCH] Move `SacrificeKind` to `Sacrificable` --- behaviours/sacrificable.gd | 13 ++++++++++++- enums.gd | 9 --------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/behaviours/sacrificable.gd b/behaviours/sacrificable.gd index 6b9d772..8d5bdde 100644 --- a/behaviours/sacrificable.gd +++ b/behaviours/sacrificable.gd @@ -2,6 +2,7 @@ extends Node class_name Sacrificable + ## Emits [signal eaten] when eaten by an [Eater] whose acceptable diets contain this node's [field diet]. ## ## To add multiple possible [Edible] diets to an entity, add multiple [Edible] nodes to it. @@ -9,8 +10,18 @@ class_name Sacrificable signal sacrificed -@export var type: Enums.MonsterType = Enums.MonsterType.Sheep +@export var type: SacrificeKind = SacrificeKind.Sheep func sarcifice(): sacrificed.emit() + + +enum SacrificeKind { + None = 0, # I hate this but in GDScript enums can't be nulls and there aren't any sum types like in rust so this is all we can do + Sheep, + Imp, + Chupacabra, + Watcher, + Cthulhu, +} diff --git a/enums.gd b/enums.gd index 8380198..1e3f301 100644 --- a/enums.gd +++ b/enums.gd @@ -8,12 +8,3 @@ enum ZIndex { Props = 0, Terrain = -10, } - -enum MonsterType { - None = 0, # I hate this but in GDScript enums can't be nulls and there aren't any sum types like in rust so this is all we can do - Sheep, - Imp, - Chupacapra, - Watcher, - Chtulu, -}