Azmyth.Assets.TerrainTile.GetNeighbor C# (CSharp) Method

GetNeighbor() public method

public GetNeighbor ( Directions direction ) : TerrainTile
direction Directions
return TerrainTile
        public TerrainTile GetNeighbor(Directions direction)
        {
            TerrainTile neighbor = null;

            if (Neighbors.ContainsKey(direction))
            {
                neighbor = Neighbors[direction];
            }
            else
            {
                neighbor = LoadNeighbor(direction);
            }

            return neighbor;
        }