Beispiel #1
0
 public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
 {
     if (this.CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
     {
         yield return(CaravanVisitUtility.TradeCommand(caravan));
     }
     if (CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
     {
         yield return(FactionGiftUtility.OfferGiftsCommand(caravan, this));
     }
     foreach (Gizmo g in base.GetCaravanGizmos(caravan))
     {
         yield return(g);
     }
     if (this.Attackable)
     {
         yield return(new Command_Action
         {
             icon = SettlementBase.AttackCommand,
             defaultLabel = "CommandAttackSettlement".Translate(),
             defaultDesc = "CommandAttackSettlementDesc".Translate(),
             action = delegate
             {
                 SettlementUtility.Attack(caravan, this.$this);
             }
         });
     }
 }
Beispiel #2
0
 public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
 {
     if (CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
     {
         yield return(CaravanVisitUtility.TradeCommand(caravan, base.Faction, TraderKind));
     }
     if ((bool)CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
     {
         yield return(FactionGiftUtility.OfferGiftsCommand(caravan, this));
     }
     foreach (Gizmo caravanGizmo in base.GetCaravanGizmos(caravan))
     {
         yield return(caravanGizmo);
     }
     if (Attackable)
     {
         Command_Action command_Action = new Command_Action();
         command_Action.icon         = AttackCommand;
         command_Action.defaultLabel = "CommandAttackSettlement".Translate();
         command_Action.defaultDesc  = "CommandAttackSettlementDesc".Translate();
         command_Action.action       = delegate
         {
             SettlementUtility.Attack(caravan, this);
         };
         yield return(command_Action);
     }
 }
        public override FloatMenuAcceptanceReport StillValid(Caravan caravan, int destinationTile)
        {
            FloatMenuAcceptanceReport floatMenuAcceptanceReport = base.StillValid(caravan, destinationTile);

            if (!floatMenuAcceptanceReport)
            {
                return(floatMenuAcceptanceReport);
            }
            if (this.settlement != null && this.settlement.Tile != destinationTile)
            {
                return(false);
            }
            return(CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this.settlement));
        }
Beispiel #4
0
        public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
        {
            _003CGetCaravanGizmos_003Ec__Iterator1 _003CGetCaravanGizmos_003Ec__Iterator = (_003CGetCaravanGizmos_003Ec__Iterator1) /*Error near IL_0040: stateMachine*/;

            if (CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
            {
                yield return((Gizmo)CaravanVisitUtility.TradeCommand(caravan));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if ((bool)CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
            {
                yield return((Gizmo)FactionGiftUtility.OfferGiftsCommand(caravan, this));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            using (IEnumerator <Gizmo> enumerator = base.GetCaravanGizmos(caravan).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    Gizmo g = enumerator.Current;
                    yield return(g);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            if (Attackable)
            {
                yield return((Gizmo) new Command_Action
                {
                    icon = AttackCommand,
                    defaultLabel = "CommandAttackSettlement".Translate(),
                    defaultDesc = "CommandAttackSettlementDesc".Translate(),
                    action = delegate
                    {
                        SettlementUtility.Attack(caravan, _003CGetCaravanGizmos_003Ec__Iterator._0024this);
                    }
                });

                /*Error: Unable to find new state assignment for yield return*/;
            }
            yield break;
IL_022e:
            /*Error near IL_022f: Unexpected return in MoveNext()*/;
        }
 internal FloatMenuAcceptanceReport <> m__0()
 {
     return(CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(this.caravan, this.settlement));
 }
 public static IEnumerable <FloatMenuOption> GetFloatMenuOptions(Caravan caravan, SettlementBase settlement)
 {
     return(CaravanArrivalActionUtility.GetFloatMenuOptions <CaravanArrivalAction_OfferGifts>(() => CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, settlement), () => new CaravanArrivalAction_OfferGifts(settlement), "OfferGifts".Translate(), caravan, settlement.Tile, settlement));
 }