Example #1
0
    public override void CreateMap(Hex origin)
    {
        EndVisualization();
        MapNodes.Clear();
        MapNodes.Add(new NavigableNode(origin, null, 0));

        int nodesExplored = 0;

        if (BattleManager.controlledCharacter == Owner)
        {
            AP = BattleManager.RemainingAP;
        }
        else
        {
            AP = Owner.ActionPoints;
        }

        while (nodesExplored < MapNodes.Count)
        {
            ExploreNode(MapNodes[nodesExplored]);
            nodesExplored++;
        }
    }
Example #2
0
    public override void CreateMap(Hex origin)
    {
        EndVisualization();
        MapNodes.Clear();

        List <Hex> hexesToCheck = new List <Hex>();

        hexesToCheck.AddRange(BoardManager.GetNeighborsOfHex(origin));

        int counter = 0;

        while (counter < hexesToCheck.Count)
        {
            Hex testingHex = hexesToCheck[counter];

            if (testingHex != null)
            {
                int distance = BoardManager.CalculateHexDistance(origin, testingHex);

                if (distance < associatedWeapon.WeaponRange)
                {
                    foreach (Hex hex in BoardManager.GetNeighborsOfHex(testingHex))
                    {
                        if (!hexesToCheck.Contains(hex) && !Contains((hex)))
                        {
                            hexesToCheck.Add(hex);
                        }
                    }
                }
                if (associatedWeapon.WeaponRange.IsInRange(distance))
                {
                    MapNodes.Add(GenerateNode(null, testingHex));
                }
            }
            counter++;
        }
    }
Example #3
0
 public void ClearPath()
 {
     MapNodes.Clear();
 }