amethyst/evoli

Why is CreatureType a String instead of an enum?

agluszak opened this issue · 1 comments

pub type CreatureType = String;

Why is CreatureType defined to be a String instead of an enum? An enum would be more typesafe. As far as I can see, it's only used for an enum-like comparison here:

if creature_type == "Carnivore" || creature_type == "Herbivore" {

The reason for this is that this way we can keep adding more creatures without modifying the code at all.
All you need is to define a prefab with a Named component.