示例#1
0
        public override void LoadContent()
        {
            base.LoadContent();

            this.mBlankTexture = this.ContentManager.Load<Texture2D>("Sprites/Blank");

            this.mButtonMenuComponent = new ButtonMenuComponent(this.ScreenSize);
            this.mButtonMenuComponent.LoadContent(this.ContentManager);
            this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonTravel);

            var lShopSectionInfos = this.ContentManager.Load<ShopSectionInfo[]>("GraphicsData/Shop/ShopSectionInfos");
            //
            // mQueenSectionComponent
            //
            this.mQueenSectionComponent = new ShopSectionComponent(lShopSectionInfos[sQueenSectionId]);
            this.mQueenSectionComponent.Tag = new Func<IGameScreen>(() => new ShopQueenSectionScreen());
            this.mQueenSectionComponent.LoadContent(this.ContentManager);
            this.mQueenSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mSuperSectionComponent
            //
            this.mSuperSectionComponent = new ShopSectionComponent(lShopSectionInfos[sSuperSectionId]);
            this.mSuperSectionComponent.Tag = new Func<IGameScreen>(() => new ShopSuperSectionScreen());
            this.mSuperSectionComponent.LoadContent(this.ContentManager);
            this.mSuperSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mFieldSectionComponent
            //
            this.mFieldSectionComponent = new ShopSectionComponent(lShopSectionInfos[sFieldSectionId]);
            this.mFieldSectionComponent.Tag = new Func<IGameScreen>(() => new ShopFieldSectionScreen());
            this.mFieldSectionComponent.LoadContent(this.ContentManager);
            this.mFieldSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mExtractionSectionComponent
            //
            this.mExtractionSectionComponent = new ShopSectionComponent(lShopSectionInfos[sExtractionSectionId]);
            this.mExtractionSectionComponent.Tag = new Func<IGameScreen>(() => new ShopExtractionSectionScreen());
            this.mExtractionSectionComponent.LoadContent(this.ContentManager);
            this.mExtractionSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mMarketSectionComponent
            //
            this.mMarketSectionComponent = new ShopSectionComponent(lShopSectionInfos[sMarketSectionId]);
            this.mMarketSectionComponent.Tag = new Func<IGameScreen>(() => new ShopMarketSectionScreen());
            this.mMarketSectionComponent.LoadContent(this.ContentManager);
            this.mMarketSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mBottlesSectionComponent
            //
            this.mBottlesSectionComponent = new ShopSectionComponent(lShopSectionInfos[sBottlesSectionId]);
            this.mBottlesSectionComponent.Tag = new Func<IGameScreen>(() => new ShopBottlesSectionScreen());
            this.mBottlesSectionComponent.LoadContent(this.ContentManager);
            this.mBottlesSectionComponent.Click += this.ShopSectionComponent_Click;
            //
            // mHudComponent
            //
            this.mHudComponent = new ShopScreenHudComponent(this.ScreenManager.BeeWorldManager, this.ScreenSize);
            this.mHudComponent.LoadContent(this.ContentManager);
        }
示例#2
0
 private void ShopSectionComponent_Click(ShopSectionComponent sectionComponent)
 {
     var lScreenFactory = (Func<IGameScreen>) sectionComponent.Tag;
     var lScreen = lScreenFactory();
     this.ScreenManager.TransitionTo(lScreen);
 }