public bool isWallBR(int x, int y, Element[,] c) { x = x + 1; y = y + 1; if ((((x < 0) || (y < 0)) || (x > c.GetLength(0) - 1) || (y > c.GetLength(1) - 1)) || c[x, y] == null || c[x, y].et.Equals(Enum.ElementTypes.PacDot) || c[x, y].et.Equals(Enum.ElementTypes.PacPlayer) || c[x, y].et.Equals(Enum.ElementTypes.Ghost) || c[x, y].et.Equals(Enum.ElementTypes.Powerup) || c[x, y].et.Equals(Enum.ElementTypes.Fruit) || c[x, y].et.Equals(Enum.ElementTypes.GhostSpawn)) { return false; } else if (c[x, y].et.Equals(Enum.ElementTypes.Wall)) { return true; } return false; }
public int WallTop(int x, int y, Element[,] c) { int count = 0; y = y - 1; if ((((x < 0) || (y < 0)) || (x > c.GetLength(0) - 1) || (y > c.GetLength(1) - 1)) || c[x,y] == null || c[x, y].et.Equals(Enum.ElementTypes.PacDot) || c[x, y].et.Equals(Enum.ElementTypes.PacPlayer) || c[x, y].et.Equals(Enum.ElementTypes.Ghost) || c[x, y].et.Equals(Enum.ElementTypes.Powerup) || c[x, y].et.Equals(Enum.ElementTypes.Fruit) || c[x, y].et.Equals(Enum.ElementTypes.GhostSpawn)) { return count; } else { count = 5; } return count; }