public static void SendExpedition(Fleet fl, Missions.Expedition exp) { //переписать //int page = ((expNumber - 1) / 8) + 1; //int line = ((expNumber - 1) % 8) + 1; if (fl.IsOkForExp(exp)==false) { try { LogWriter.WriteLogSucces(String.Format("Fleet {0} will be reequiped for expedition {1}", fl.ID, exp.ID)); fl.ClearShips(); fl = Dock.Fleets[fl.ID - 1]; Missions.FleetCreator flk = new Missions.FleetCreator(exp); Fleet tmp = flk.EquipForExpedition(); fl.FillFleetWithShips(tmp); fl = Dock.Fleets[fl.ID - 1]; if (fl.IsOkForExp(exp) == false) throw new AlgoritmicException("Strange thing happened i dunno"); LogWriter.WriteLogSucces(String.Format("Fleet {0} successfully equiped for expedition {1}", fl.ID, exp.ID)); } catch (Exception ex) { LogWriter.WriteLogOnException(ex); return; } } if (fl.IsSuplied == false) { HttpSender.SupplyFleet(fl); Map.ReloadMainMenu(); } Map.OpenExpeditions(); (Map.CurrentFrame as Expeditions).StartExpedition(exp.PageInList, exp.RowInPage, fl.ID); // Map.OpenMainMenu(); }
public void FillFleetWithShips(Fleet fl) { int i=0; foreach (Ship sh in fl.Ships) { HttpSender.ChangeShipInFleet(this,i , sh.ID_Fleet); i++; System.Threading.Thread.Sleep(1000); } Map.ReloadMainMenu(); }