public Target ToTarget(FightStatus fightStatus) { switch (ValueCase) { case ValueOneofCase.Cell: return(new Target((Coord)Cell)); case ValueOneofCase.EntityId: return(new Target(fightStatus.GetEntity(EntityId))); default: throw new ArgumentOutOfRangeException(); } }