Exemplo n.º 1
0
        private bool ShipDock(MessageShipCommand msg, ShipController sc)
        {
            bool success = false;

            if (sc.checkValidDockCommand(msg))
            {
                Ship   s = _model.Ships.Where(x => x.ShipId == msg.ShipId).First();
                Planet p = _model.Planets.Where(x => x.StarChartId == ((MessageShipDocking)msg.Command).DockingTargetId).FirstOrDefault();
                _planetCs[p.PlanetId].DockShip(s);
                sc.Dock(p);
                success = true;
            }
            return(success);
        }
Exemplo n.º 2
0
 private bool ShipDock(MessageShipCommand msg, ShipController sc)
 {
     bool success = false;
     if (sc.checkValidDockCommand(msg))
     {
         Ship s = _model.Ships.Where(x => x.ShipId == msg.ShipId).First();
         _planetCs[sc.GetDestination.PlanetId].DockShip(s);
         sc.Dock();
         success = true;
     }
     return success;
 }