public void DisbandSelectedUnits()
 {
     if (this.Garrison != null)
     {
         this.DisbandComputeCandidates();
         OrderDisbandUnits order = new OrderDisbandUnits(this.Garrison.Empire.Index, this.salableUnits.ConvertAll <GameEntityGUID>((Unit unit) => unit.GUID).ToArray());
         base.AgeTransform.Enable = false;
         Ticket ticket;
         this.playerControllerRepositoryService.ActivePlayerController.PostOrder(order, out ticket, new EventHandler <TicketRaisedEventArgs>(this.OnOrderResponse));
     }
 }
Exemple #2
0
 private SynchronousJobState SynchronousJob_TryConvertSuperfluousSettlersToPops()
 {
     for (int i = 0; i < this.departmentOfTheInterior.NonInfectedCities.Count; i++)
     {
         for (int j = 0; j < this.departmentOfTheInterior.Cities[i].StandardUnits.Count; j++)
         {
             if (this.departmentOfTheInterior.Cities[i].StandardUnits[j].IsSettler)
             {
                 this.cityWithRemovedSettlerIndex = i;
                 OrderDisbandUnits order = new OrderDisbandUnits(base.AIEntity.Empire.Index, new GameEntityGUID[]
                 {
                     this.departmentOfTheInterior.Cities[i].StandardUnits[j].GUID
                 });
                 Ticket ticket;
                 base.AIEntity.Empire.PlayerControllers.AI.PostOrder(order, out ticket, new EventHandler <TicketRaisedEventArgs>(this.RemoveSettlerResponse));
                 return(SynchronousJobState.Success);
             }
         }
         if (this.departmentOfTheInterior.Cities[i].Camp != null)
         {
             for (int k = 0; k < this.departmentOfTheInterior.Cities[i].Camp.StandardUnits.Count; k++)
             {
                 if (this.departmentOfTheInterior.Cities[i].Camp.StandardUnits[k].IsSettler)
                 {
                     this.cityWithRemovedSettlerIndex = i;
                     OrderDisbandUnits order2 = new OrderDisbandUnits(base.AIEntity.Empire.Index, new GameEntityGUID[]
                     {
                         this.departmentOfTheInterior.Cities[i].Camp.StandardUnits[k].GUID
                     });
                     Ticket ticket2;
                     base.AIEntity.Empire.PlayerControllers.AI.PostOrder(order2, out ticket2, new EventHandler <TicketRaisedEventArgs>(this.RemoveSettlerResponse));
                     return(SynchronousJobState.Success);
                 }
             }
         }
     }
     return(SynchronousJobState.Success);
 }