catan.Tile.hasNeighbor C# (CSharp) Méthode

hasNeighbor() public méthode

public hasNeighbor ( NeighborLocation loc ) : System.Boolean
loc NeighborLocation
Résultat System.Boolean
        public Boolean hasNeighbor(NeighborLocation loc)
        {
            return Neighbors.ContainsKey(loc);
        }

Usage Example

Exemple #1
0
        private void checkNeighbors(Tile currentTile, int widthCounter)
        {
            widthCounter++;
            for (int i = 0; i < 6; ++i)
            {
                int a = 0;
                a++;
                Debug.Assert(LandTileHeap.Count != 0);

                if (!currentTile.hasNeighbor((NeighborLocation)i))
                {
                    currentTile.addNeighbor(LandTileHeap.TakeAway(rand.Next() % LandTileHeap.Count), (NeighborLocation)i);
                    currentTile.Neighbors.Single(n => n.Key == (NeighborLocation)i).Value.addNeighbor(currentTile, (NeighborLocation)((i + 3) % 6));
                    Tile tempTile = currentTile.Neighbors.Single(n => n.Key == (NeighborLocation)i).Value;

                    for (int j = 0; j < i; ++j)
                    {
                        tempTile.addNeighbor(currentTile.Neighbors.Single(n => n.Key == (NeighborLocation)j).Value, (NeighborLocation)(((j + 3) % 6) - 1));
                    }


                    if (widthCounter < 3)
                    {
                        checkNeighbors(tempTile, widthCounter);
                    }
                }
            }
        }
All Usage Examples Of catan.Tile::hasNeighbor