public static EntityDefinition GetEntDef(HologramMode mode, string rawDef) { switch (mode) { case HologramMode.NPC: return(NPCDefinition.FromString(rawDef)); case HologramMode.Item: return(ItemDefinition.FromString(rawDef)); case HologramMode.Projectile: return(ProjectileDefinition.FromString(rawDef)); default: throw new NotImplementedException("No such mode.."); } }