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."); } }
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."); } }
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); }
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); }
protected override bool FinalIntern(BaseReqArgument bra) { return(false); }
protected override bool CheckIntern(BaseReqArgument bra) { return(Application.platform == Parse(bra)); }
protected override string DescIntern(BaseReqArgument bra) { return($"Need the platform {bra.sett}"); }
private RuntimePlatform Parse(BaseReqArgument bra) { return((RuntimePlatform)Enum.Parse(typeof(RuntimePlatform), bra.sett, true)); }
protected abstract string DescIntern(BaseReqArgument bra);
protected abstract bool FinalIntern(BaseReqArgument bra);
protected abstract bool CheckIntern(BaseReqArgument bra);