Exemple #1
0
        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);
        }
Exemple #2
0
 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");
 }