public void MapGridSetup()
        {
            var groundMatrix = GridConverter.ToGroundTypeMatrix(_gameInfo.StartRaw.PlacementGrid, _gameInfo.StartRaw.PathingGrid, _gameInfo.StartRaw.PlayableArea);

            groundMatrix[20, 130].Should().Be(Ground.Airspace);
            groundMatrix[21, 130].Should().Be(Ground.BuildingPlacable);
            groundMatrix[39, 123].Should().Be(Ground.Pathable); // Top left of ramp
            groundMatrix[37, 118].Should().Be(Ground.Pathable); // Bottom right of ramp (ramp points to left)
        }
示例#2
0
        public void Setup()
        {
            _currentObservation = new Observation
            {
                PlayerCommon = new PlayerCommon {
                    FoodWorkers = 0
                },
                RawData = new ObservationRaw {
                    Units = { new Unit {
                                  UnitType = ConstantManager.Scv, Alliance = Alliance.Self, BuildProgress = 1, Tag = Tag, Pos = new Point{
                                      X = 20, Y = 25
                                  }
                              } }
                }
            };
            Game.ResponseGameInfo = new ResponseGameInfo {
                StartRaw = new StartRaw()
            };
            Game.ResponseGameInfo.StartRaw.PlacementGrid = new ImageData
            {
                Data = ByteString.CopyFrom(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), // Each bit is 1
                Size = new Size2DI {
                    X = 10, Y = 10
                }
            };
            Game.ResponseGameInfo.StartRaw.PathingGrid = new ImageData
            {
                Data = ByteString.CopyFrom(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), // Each bit is 1
                Size = new Size2DI {
                    X = 10, Y = 10
                }
            };
            Game.ResponseGameInfo.StartRaw.PlayableArea = new RectangleI
            {
                P0 = new PointI {
                    X = 1, Y = 1
                },
                P1 = new PointI {
                    X = 9, Y = 9
                }
            };

            Game.MapManager = new MapManager(GridConverter.ToGroundTypeMatrix(Game.ResponseGameInfo.StartRaw.PlacementGrid, Game.ResponseGameInfo.StartRaw.PathingGrid, Game.ResponseGameInfo.StartRaw.PlayableArea)
                                             , new Point {
                X = 3, Y = 7, Z = 0
            });                                       // Main Base is top left
        }