Пример #1
0
        public Map(int width, int height)
        {
            Width          = width;
            Height         = height;
            _matrix        = new Colors[Width, Height];
            Ant            = new Ant();
            Ant.Coordinate = Point.Construct(Width / 2, Height / 2);

            var random = new Random();

            for (int i = 0; i < Width; i++)
            {
                for (int j = 0; j < Height; j++)
                {
                    _matrix[i, j] = random.Next(2) == 0 ? Colors.Black : Colors.White;
                }
            }
        }
Пример #2
0
 public Colors GetColor(Ant ant)
 {
     return(_matrix[ant.Coordinate.X, ant.Coordinate.Y]);
 }
Пример #3
0
 public void SetAnt(Ant ant)
 {
     this.Ant = ant;
 }