public bool UnregisterShip() { bool ret = (registeredShipIGC != null); registeredShipIGC = null; return(ret); }
public void Main(string argument, UpdateType updateType) { while (hangarBroadcastListener.HasPendingMessage) { MyIGCMessage igc_message = hangarBroadcastListener.AcceptMessage(); ShipIGC ship_igc; if (shipIGCs.ContainsKey(igc_message.Source)) { ship_igc = shipIGCs[igc_message.Source]; } else { ship_igc = new ShipIGC(igc_message.Source, IGC); shipIGCs.Add(igc_message.Source, ship_igc); } try { string igc_message_data = igc_message.As <string>(); if (igc_message_data != null) { shipCommands.Parse(igc_message_data, ship_igc); } } catch (Exception e) { Echo(e.ToString()); } } }
public static bool RegisterShipCommand(IReadOnlyList <string> arguments, ShipIGC shipIGC) { bool ret = !(shipIGC.IsRegistered); shipIGC.IsRegistered = true; shipIGC.Name = arguments[0]; return(ret); }
public static bool DiscoverHangarCommand(IReadOnlyList <string> arguments, ShipIGC shipIGC) { bool ret = false; if (!(shipIGC.IsRegistered)) { shipIGC.Send("identify"); } return(ret); }
public static bool DockShipCommand(IReadOnlyList <string> arguments, ShipIGC shipIGC) { bool ret = false; if (shipIGC.IsRegistered) { } else { shipIGC.Send("identify"); } return(ret); }
public bool RegisterShip(ShipIGC shipIGC) { if (shipIGC == null) { throw new ArgumentNullException(nameof(shipIGC)); } bool ret = false; if (registeredShipIGC == null) { registeredShipIGC = shipIGC; ret = true; } return(ret); }
public static bool UndockShipCommand(IReadOnlyList <string> arguments, ShipIGC shipIGC) { bool ret = false; return(ret); }