Ejemplo n.º 1
0
        public void Setup()
        {
            // From AcropolisLE.SC2Map
            var mapSize = new Size2DI {
                X = 176, Y = 184
            };

            _gameInfo = new ResponseGameInfo
            {
                StartRaw = new StartRaw
                {
                    MapSize     = mapSize,
                    PathingGrid = new ImageData
                    {
                        BitsPerPixel = 1,
                        Size         = mapSize,
                        Data         = ByteString.FromBase64(PathingGridBitmap)
                    },
                    PlacementGrid = new ImageData
                    {
                        BitsPerPixel = 1,
                        Size         = mapSize,
                        Data         = ByteString.FromBase64(PlacementGridBitmap)
                    },
                    PlayableArea = new RectangleI
                    {
                        P0 = new PointI {
                            X = 18, Y = 18
                        },
                        P1 = new PointI {
                            X = 156, Y = 153
                        }
                    }
                }
            };

            // Test grid setup
            GridConverter.GetDataValueBit(_gameInfo.StartRaw.PathingGrid, 22, 131).Should().Be(1);
            GridConverter.GetDataValueBit(_gameInfo.StartRaw.PlacementGrid, 22, 131).Should().Be(1);
            GridConverter.GetDataValueBit(_gameInfo.StartRaw.PathingGrid, 40, 124).Should().Be(1);
            GridConverter.GetDataValueBit(_gameInfo.StartRaw.PlacementGrid, 40, 123).Should().Be(0);
        }