public void SetVesselRole(Guid vesselId, VesselRole vesselRole, Player player) { var vessel = _vessels.FirstOrDefault(x => x.Id == vesselId); if (vessel == null) { throw new KeyNotFoundException($"Could not find vessel for id {vesselId}"); } vessel.SetVesselRole(vesselRole, player); }
public void SetVesselRole(VesselRole vesselRole, Player player) { if (vesselRole.Equals(VesselRole.Captain)) { Captain = player; return; } if (vesselRole.Equals(VesselRole.Radioman)) { Radioman = player; return; } throw new KeyNotFoundException($"Vessel role matching value '{vesselRole.Value}' does not exist on the current vessel"); }