Example #1
0
        public Square Add(int x, int y)
        {
            var square = new Square(this, x, y);

            Squares.Add(square);

            return square;
        }
Example #2
0
 bool IsValidForAdd(Square square)
 {
     return !(square.IsHazard || availableSquares.Contains(square));
 }
Example #3
0
 void Available(Square square)
 {
     if (IsValidForAdd(square)) availableSquares.Add(square);
 }
Example #4
0
        void AvailableAround(Square square)
        {
            if (visited.Contains(square)) return;

            foreach (var item in square.Around()) Available(item);

            visited.Add(square);
        }
Example #5
0
 public void Location(int x, int y)
 {
     currentLocation = map.FindOrAdd(x, y);
 }