public static InfantryDeathType GetInfantryDeathType(this Warhead self) { switch (self) { case Warhead.Bullet: return(InfantryDeathType.Bullet); case Warhead.Explosive: return(InfantryDeathType.Explosive); case Warhead.Fire: return(InfantryDeathType.Fire); default: throw new Exception("unhandled warhead: " + self.ToString()); } }