Ejemplo n.º 1
0
        public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
        {
            if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 4, out Tile tile))
            {
                RenderSize = new Size(tile.Image.Width / Globals.TileScale, tile.Image.Height / Globals.TileScale);
            }

            var mockInfantry = new Infantry(null)
            {
                Type      = this,
                House     = house,
                Strength  = 256,
                Direction = direction
            };
            var infantryThumbnail = new Bitmap(Globals.TileWidth, Globals.TileHeight);

            using (var g = Graphics.FromImage(infantryThumbnail))
            {
                MapRenderer.Render(theater, Point.Empty, Globals.TileSize, mockInfantry, InfantryStoppingType.Center).Item2(g);
            }
            Thumbnail = infantryThumbnail;
        }
Ejemplo n.º 2
0
        public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
        {
            var mockBuilding = new Building()
            {
                Type      = this,
                House     = house,
                Strength  = 256,
                Direction = direction
            };

            var render = MapRenderer.Render(gameType, theater, Point.Empty, Globals.TileSize, Globals.TileScale, mockBuilding);

            if (!render.Item1.IsEmpty)
            {
                var buildingPreview = new Bitmap(render.Item1.Width, render.Item1.Height);
                using (var g = Graphics.FromImage(buildingPreview))
                {
                    render.Item2(g);
                }
                Thumbnail = buildingPreview;
            }
        }
Ejemplo n.º 3
0
        public void Init(GameType gameType, TheaterType theater, HouseType house, DirectionType direction)
        {
            if (Globals.TheTilesetManager.GetTileData(theater.Tilesets, Name, 0, out Tile tile))
            {
                RenderSize = new Size(tile.Image.Width / Globals.TileScale, tile.Image.Height / Globals.TileScale);
            }

            var mockUnit = new Unit()
            {
                Type      = this,
                House     = house,
                Strength  = 256,
                Direction = direction
            };
            var unitThumbnail = new Bitmap(Globals.TileWidth * 3, Globals.TileHeight * 3);

            using (var g = Graphics.FromImage(unitThumbnail))
            {
                MapRenderer.Render(gameType, theater, new Point(1, 1), Globals.TileSize, mockUnit).Item2(g);
            }
            Thumbnail = unitThumbnail;
        }
Ejemplo n.º 4
0
 public House(HouseType type)
 {
     Type   = type;
     Allies = new AlliesMask(1 << Type.ID);
 }