Coord.Equals C# (CSharp) Method

Equals() public method

public Equals ( Coord coord ) : bool
coord Coord
return bool
    public bool Equals(Coord coord)
    {
        return this.Equals (coord.x, coord.y);
    }

Same methods

Coord::Equals ( Vector2 vector ) : bool
Coord::Equals ( float x, float y ) : bool
Coord::Equals ( int x, int y ) : bool

Usage Example

Example #1
0
        // true on tile being 5x5 grid away from wall
        bool FarFromWall(Coord tile)
        {
            if (edgeTiles.Contains(tile))
            {
                return(false);
            }

            for (int x = tile.tileX - 2; x <= tile.tileX + 2; x++)
            {
                for (int y = tile.tileY - 2; y <= tile.tileY + 2; y++)
                {
                    if (tile.Equals(new Coord(x, y)))
                    {
                        continue;
                    }
                    if (edgeTiles.Contains(new Coord(x, y)))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
All Usage Examples Of Coord::Equals