Coord.Equals C# (CSharp) Method

Equals() public method

public Equals ( int x, int y ) : bool
x int
y int
return bool
    public bool Equals(int x, int y)
    {
        if (x == this.x && y == this.y) {
            return true;
        }

        return false;
    }

Same methods

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

Usage Example

Exemplo n.º 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