Beispiel #1
0
        protected override bool CheckIntern(BaseReqArgument bra)
        {
            bra.NeedMapException();

            if (bra.sett == "near")
            {
                foreach (var pos in CircleGenerator.Gen(bra.pos, 1))
                {
                    if (S.Players().OverlayHighest("frontier", pos) == bra.player)
                    {
                        return(true);
                    }
                }
                return(false);
            }

            var p = S.Players().OverlayHighest("frontier", bra.pos);

            switch (bra.sett)
            {
            case "own":
                return(p == bra.player);

            case "enemy":
                return(p != null && p != bra.player);

            case "none":
                return(p == null);

            default:
                throw new ArgumentException(bra.sett + " is unknown.");
            }
        }
Beispiel #2
0
        protected override bool CheckIntern(BaseReqArgument bra)
        {
            bra.NeedMapException();

            if (bra.onMap == null)
            {
                bra.onMap = S.Unit().At(bra.pos);
            }

            if (bra.onMap == null)
            {
                return(false);
            }

            switch (bra.sett)
            {
            case "own":
                return(bra.onMap.Player() == bra.player);

            case "enemy":
                return(bra.onMap.Player() != bra.player);

            default:
                throw new ArgumentException(bra.sett + " is unknown.");
            }
        }
Beispiel #3
0
        protected override string DescIntern(BaseReqArgument bra)
        {
            string mess;

            switch (bra.sett)
            {
            case "own":
                mess = "The unit muss be your own unit.";
                break;

            case "enemy":
                mess = "The unit muss not be your own unit.";
                break;

            default:
                mess = bra.sett + " is unknown.";
                break;
            }

            if (bra.NeedMap())
            {
                if (bra.onMap == null)
                {
                    bra.onMap = S.Unit().At(bra.pos);
                }

                if (bra.onMap == null)
                {
                    mess += $" Here is no unit.";
                }
                else
                {
                    mess += $" {bra.onMap.name} is " + (bra.player == bra.onMap.Player() ? "" : "not") +
                            " your own unit";
                }
            }

            return(mess);
        }
Beispiel #4
0
        protected override string DescIntern(BaseReqArgument bra)
        {
            string mess = S.T("frontier" + TextHelper.Cap(bra.sett));

            if (bra.NeedMap())
            {
                var p = S.Players().OverlayHighest("frontier", bra.pos);
                if (p == bra.player)
                {
                    mess = S.T("frontierOwnHere", mess);
                }
                else if (p != null && p != bra.player)
                {
                    mess = S.T("frontierEnemyHere", mess);
                }
                else if (p == null)
                {
                    mess = S.T("frontierNoneHere", mess);
                }
            }

            return(mess);
        }
Beispiel #5
0
 protected override bool FinalIntern(BaseReqArgument bra)
 {
     return(false);
 }
Beispiel #6
0
 protected override bool CheckIntern(BaseReqArgument bra)
 {
     return(Application.platform == Parse(bra));
 }
Beispiel #7
0
 protected override string DescIntern(BaseReqArgument bra)
 {
     return($"Need the platform {bra.sett}");
 }
Beispiel #8
0
 private RuntimePlatform Parse(BaseReqArgument bra)
 {
     return((RuntimePlatform)Enum.Parse(typeof(RuntimePlatform), bra.sett, true));
 }
Beispiel #9
0
 protected abstract string DescIntern(BaseReqArgument bra);
Beispiel #10
0
 protected abstract bool FinalIntern(BaseReqArgument bra);
Beispiel #11
0
 protected abstract bool CheckIntern(BaseReqArgument bra);