Пример #1
0
 internal DecoCatalogItem(DecoCatalogManager collectionManager, string imagePath, DecoMetadata dmd, int itemWidth, int itemHeight) : base(imagePath, dmd)
 {
     CatalogManager = collectionManager;
     DecoMetadata   = dmd;
     ItemWidth      = itemWidth;
     ItemHeight     = itemHeight;
     SourceRect     = new Int32Rect(0, 0, itemWidth, itemHeight);
 }
Пример #2
0
        public DecoCatalogViewModel(IMainGame mainGame)
        {
            MainGame = mainGame;

            var decoCatalog1x1x1Args = new DecoCatalogArgs()
            {
                CatalogName        = "1x1x1",
                ImportDirectory    = UriHelper.Deco1x1x1Directory,
                DecoDimension      = new Dimension(1, 1, 1),
                DecoPositionOffset = new Vector2(0, 0),
                ItemWidth          = 72,
                ItemHeight         = 75,
            };

            DecoCatalog1x1x1 = new DecoCatalogManager(this, decoCatalog1x1x1Args);

            var decoCatalog1x1x2Args = new DecoCatalogArgs()
            {
                CatalogName        = "1x1x2",
                ImportDirectory    = UriHelper.Deco1x1x2Directory,
                DecoDimension      = new Dimension(1, 1, 2),
                DecoPositionOffset = new Vector2(0, -36),
                ItemWidth          = 72,
                ItemHeight         = 111,
            };

            DecoCatalog1x1x2 = new DecoCatalogManager(this, decoCatalog1x1x2Args);

            var decoCatalog1x1x3Args = new DecoCatalogArgs()
            {
                CatalogName        = "1x1x3",
                ImportDirectory    = UriHelper.Deco1x1x3Directory,
                DecoDimension      = new Dimension(1, 1, 3),
                DecoPositionOffset = new Vector2(0, -72),
                ItemWidth          = 72,
                ItemHeight         = 147,
            };

            DecoCatalog1x1x3 = new DecoCatalogManager(this, decoCatalog1x1x3Args);

            var decoCatalog2x2x2Args = new DecoCatalogArgs()
            {
                CatalogName        = "2x2x2",
                ImportDirectory    = UriHelper.Deco2x2x2Directory,
                DecoDimension      = new Dimension(2, 2, 2),
                DecoPositionOffset = new Vector2(-36, -72),
                ItemWidth          = 144,
                ItemHeight         = 147,
            };

            DecoCatalog2x2x2 = new DecoCatalogManager(this, decoCatalog2x2x2Args);

            var decoCatalog3x3x3Args = new DecoCatalogArgs()
            {
                CatalogName        = "3x3x3",
                ImportDirectory    = UriHelper.Deco3x3x3Directory,
                DecoDimension      = new Dimension(3, 3, 3),
                DecoPositionOffset = new Vector2(-72, -108),
                ItemWidth          = 216,
                ItemHeight         = 219,
            };

            DecoCatalog3x3x3 = new DecoCatalogManager(this, decoCatalog3x3x3Args);
        }