Exemplo n.º 1
0
        public static IEnumerable <FloatMenuOption> GetFloatMenuOptions(CompLaunchablePawn representative, IEnumerable <IThingHolder> pods, Settlement settlement)
        {
            if (ByakheeArrivalAction_AttackSettlement.CanAttack(pods, settlement))
            {
                yield break;
            }

            Func <FloatMenuAcceptanceReport>             acceptanceReportGetter = new Func <FloatMenuAcceptanceReport>(() => CanAttack(pods, settlement));
            Func <ByakheeArrivalAction_AttackSettlement> dropAtEdge             = new Func <ByakheeArrivalAction_AttackSettlement>(() => arrivalActionEdgeDrop(settlement));

            Func <FloatMenuAcceptanceReport> idunno = null;

            foreach (FloatMenuOption floatMenuOption in ByakheeArrivalActionUtility.GetFloatMenuOptions <ByakheeArrivalAction_AttackSettlement>(acceptanceReportGetter, dropAtEdge, "AttackAndDropAtEdge".Translate(settlement.Label), representative, settlement.Tile, null))
            {
                yield return(floatMenuOption);
            }


            Func <ByakheeArrivalAction_AttackSettlement> dropAtCenter = new Func <ByakheeArrivalAction_AttackSettlement>(() => arrivalActionCenterDrop(settlement));

            foreach (FloatMenuOption floatMenuOption2 in ByakheeArrivalActionUtility.GetFloatMenuOptions <ByakheeArrivalAction_AttackSettlement>(acceptanceReportGetter, dropAtCenter, "AttackAndDropInCenter".Translate(settlement.Label), representative, settlement.Tile, null))
            {
                yield return(floatMenuOption2);
            }
            yield break;
        }
Exemplo n.º 2
0
        public override FloatMenuAcceptanceReport StillValid(IEnumerable <IThingHolder> pods, int destinationTile)
        {
            FloatMenuAcceptanceReport floatMenuAcceptanceReport = base.StillValid(pods, destinationTile);

            if (!floatMenuAcceptanceReport)
            {
                return(floatMenuAcceptanceReport);
            }
            if (this.settlement != null && this.settlement.Tile != destinationTile)
            {
                return(false);
            }
            return(ByakheeArrivalAction_AttackSettlement.CanAttack(pods, this.settlement));
        }