Exemplo n.º 1
0
        public TileMapSprites(GameSystem gs, GameWorldSystem gw, MapSpritesInfo msi, bool isEditor = false)
            : base(gs, gw, isEditor)
        {
            mapSpritesInfo = msi;

            tileSprite = new AutoTileSprite(tileWidth, tileHeight);

            int size = 4;

            selector = new SpriteRectangle()
            {
                color     = Color.White,
                boundSize = size,
                size      = new Size(tileWidth - size, tileHeight - size)
            };

            resize();
        }
Exemplo n.º 2
0
        public TileMapDetailSprites(GameSystem gs, GameWorldSystem gw, MapSpritesInfo msi, bool isEditor = false) : base(gs, gw, msi, isEditor)
        {
            var ti   = gameWorldData.masterData.terrainImage;
            var list = ti.Values.ToList();
            var rc   = resourcePackageCache;

            terrainSprite       = ti.Where(o => o.Value.animationDetail != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetail));
            terrainSpriteSpring = ti.Where(o => o.Value.animationDetailSpring != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetailSpring));
            terrainSpriteSummer = ti.Where(o => o.Value.animationDetailSummer != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetailSummer));
            terrainSpriteAutumn = ti.Where(o => o.Value.animationDetailAutumn != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetailAutumn));
            terrainSpriteWinter = ti.Where(o => o.Value.animationDetailWinter != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetailWinter));
            terrainSpriteSnow   = ti.Where(o => o.Value.animationDetailSnow != null).ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value.animationDetailSnow));

            //strongholdSprite = mii.strongholdAnimation.ToDictionary(o => o.Key, o => new TileSpriteAnimation(o.Value));

            list.ForEach(o => o.animationDetail?.ForEach(oo => rc.getTileMapImage(oo.fileName)));
            list.ForEach(o => o.animationDetailSpring?.ForEach(oo => rc.getTileMapImage(oo.fileName)));
            list.ForEach(o => o.animationDetailSummer?.ForEach(oo => rc.getTileMapImage(oo.fileName)));
            list.ForEach(o => o.animationDetailAutumn?.ForEach(oo => rc.getTileMapImage(oo.fileName)));
            list.ForEach(o => o.animationDetailWinter?.ForEach(oo => rc.getTileMapImage(oo.fileName)));
            list.ForEach(o => o.animationDetailSnow?.ForEach(oo => rc.getTileMapImage(oo.fileName)));

            //mii.strongholdAnimation.Values.ToList().ForEach(o => gameWorld.getImage(o.fileName));
        }