Exemplo n.º 1
0
	    public Brain(MapExplored mapExplored, Robot robot)
		{
            _mapExplored = mapExplored;
            _robot = robot;

            // set first waypoint
            // CreateNextWaypoint();
        }
Exemplo n.º 2
0
		public Sensor(Robot robot, Canvas canvas, Sight sight)
		{
			Robot = robot;
			Sight = sight;
			Canvas = canvas;
			BaseArea = new Lazy<CartesianArray<MapElementStatus>>(
				() => CartesianArray<MapElementStatus>.FromArray(GetBaseFieldMap(GetStructureBitmap(Canvas))));
		}
        private void buildMap()
        {
            // get reference of robot
            if (_map != null)
            {
                _robot = _map.Elements.OfType<Robot>().First();
                _robot.Initialize(_mapArea, new Sensor(_robot, _mapArea, new Sight { Angle = 180, Reach = int.MaxValue }));

                _minimap = new Minimap(_minimapArea, _minimapAreaVisited, _robot.MapExplored);
            }
        }
Exemplo n.º 4
0
        public CartesianArray<MapElementStatus> GetRobotCenteredMapCopy(Robot robot, CartesianArray<MapElementStatus> src)
        {
            var copy = src.Clone();

            copy.XOffset = - robot.StartPosition.X;
            copy.YOffset = - (src.Height - robot.StartPosition.Y);

            return copy;
        }