Example #1
0
    public void GoToZone(int zoneId)
    {
        Zone g = Zone.Get(zoneId);

        if (g == null)
        {
            return;
        }
        wantedPath = AllWaysGoToRome.GetPath(g, currentPosition);
    }
Example #2
0
    public static List <Zone> GetAllEnemyZone(Zone from)
    {
        Zone[] array = Zone.GetZones();
        Dictionary <int, ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);
        var res = from a in array
                  where CheckCondition(NextType.EnemyZone, a)
                  orderby a.data.incomingSquad ascending, GetDistanceFrom(a.id, allWays) ascending
        select a;

        return(res.ToList());
    }
Example #3
0
    public static List <Zone> GetAllNextStation(Zone from, int minPlatinum = 1)
    {
        Zone[] array = Zone.GetZones();
        Dictionary <int, ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);

        var res = from a in array
                  where a.data.platinum >= minPlatinum && (a.IsNeutralZone() || a.IsOwnedByEnemy())
                  orderby GetDistanceFrom(a.id, allWays), a.data.platinum descending
        select a;

        return(res.ToList());
    }
Example #4
0
    public static List <Zone> GetAllNextStation(Zone from)
    {
        Zone[] array = Zone.GetZones();
        Dictionary <int, ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);

        var res = from a in array
                  where CheckCondition(NextType.StationZone, a)
                  orderby GetDistanceFrom(a.id, allWays), a.data.platinum descending
        select a;

        return(res.ToList());
    }
Example #5
0
    public static List <Zone> GetAllUndiscoveredZone(Zone from = null)
    {
        Zone[] array = Zone.GetZones();
        Dictionary <int, ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);

        var res = from a in array
                  where a.data.viewed == false
                  orderby GetDistanceFrom(a.id, allWays)
                  // orderby a.data.platinum descending
                  //testing
                  select a;

        return(res.ToList());
    }
Example #6
0
    //TOADDATHOME
    //public static List<Zone> GetNext_TEST(Zone from)
    //{
    //    Zone[] array = Zone.GetZones();
    //   Dictionary<int,ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);

    //    var res = from a in array
    //              where a.IsNeutralZone()
    //              orderby GetDistanceFrom(a.id, allWays), a.data.platinum descending
    //              select a;
    //    return res.ToList();
    //}


    public static List <Zone> GetAllNextNeutral(Zone from = null)
    {
        Zone[] array = Zone.GetZones();
        Dictionary <int, ShortestWayNode> allWays = AllWaysGoToRome.GetMap(from);

        var res = from a in array
                  where a.IsNeutralZone()
                  orderby GetDistanceFrom(a.id, allWays) ascending, a.data.platinum descending
        // orderby a.data.platinum descending
        //testing
        select a;

        return(res.ToList());
    }
Example #7
0
    public void AddGoToZone(int zoneId)
    {//Si aucun définit, ajout du chemin simplement
        if (wantedPath.Count == 0)
        {
            GoToZone(zoneId); return;
        }
        Zone from = GetMissionDestination();
        Zone g    = Zone.Get(zoneId);

        if (g == null)
        {
            return;
        }
        wantedPath = AllWaysGoToRome.GetPath(g, from);
    }
Example #8
0
    //public FixedMap map;

    public void SetPlayerOrigineZone(bool isEnemy, Zone zone)
    {
        if (isEnemy)
        {
            enemyFlagLocalisation = zone;
            enemyFlagPath         = AllWaysGoToRome.GetMap(zone);
        }
        else
        {
            myFlagLocalisation = zone;
            myFlagPath         = AllWaysGoToRome.GetMap(zone);
        }
        if (myFlagLocalisation != null && enemyFlagPath != null)
        {
            ShortestWayNode swn = null;
            enemyFlagPath.TryGetValue(myFlagLocalisation.id, out swn);
            CostNodeZone nz = swn.GetNextNodeZone();
            enemyDistance = nz.cost;
        }
    }