public override void LoadContent() { base.LoadContent(); this.mPlayerManager = this.ScreenManager.BeeWorldManager.PlayerManager; this.mPlayer = this.mPlayerManager.Player; this.mBlankTexture = this.ContentManager.Load<Texture2D>("Sprites/Blank"); this.mConfirmationDialogComponent = new ConfirmationDialogComponent(this.ScreenSize); this.mConfirmationDialogComponent.LoadContent(this.ContentManager); this.mConfirmationDialogComponent.CancelText = "No"; this.mConfirmationDialogComponent.ConfirmText = "Yes"; this.mConfirmationDialogComponent.Confirm += this.ConfirmationDialogComponent_Confirm; this.mButtonMenuComponent = new ButtonMenuComponent(this.ScreenSize); this.mButtonMenuComponent.LoadContent(this.ContentManager); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBuy); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBack); }
public override void LoadContent() { base.LoadContent(); this.mPlayerManager = this.ScreenManager.BeeWorldManager.PlayerManager; this.mPlayer = this.mPlayerManager.Player; this.mBlankTexture = this.ContentManager.Load<Texture2D>("Sprites/Blank"); this.mQueenBeeRepository = new QueenBeeRepository(this.ContentManager); this.mHudComponent = new ShopScreenHudComponent(this.ScreenManager.BeeWorldManager, this.ScreenSize); this.mHudComponent.LoadContent(this.ContentManager); this.mConfirmationDialogComponent = new ConfirmationDialogComponent(this.ScreenSize); this.mConfirmationDialogComponent.LoadContent(this.ContentManager); this.mConfirmationDialogComponent.CancelText = "No"; this.mConfirmationDialogComponent.ConfirmText = "Yes"; this.mConfirmationDialogComponent.Cancel += this.ConfirmationDialogComponent_Cancel; this.mConfirmationDialogComponent.Confirm += this.ConfirmationDialogComponent_Confirm; this.mButtonMenuComponent = new ButtonMenuComponent(this.ScreenSize); this.mButtonMenuComponent.LoadContent(this.ContentManager); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBuy); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBack); this.mMiddleItemComponent.LoadContent(this.ContentManager); this.mMiddleItemComponent.IconTexture = this.mBlankTexture; this.mMiddleItemComponent.Size = this.mItemSize; this.mMiddleItemComponent.Position = new Vector2( (this.ScreenSize.X - this.mItemSize.X) / 2f, (this.ScreenSize.Y - this.mItemSize.Y - this.mHudComponent.Size.Y) / 2f); this.mMiddleItemComponent.Price = 2; this.mMiddleItemComponent.Click += this.SelectItemComponent; this.mTopItemComponent.LoadContent(this.ContentManager); this.mTopItemComponent.IconTexture = this.mBlankTexture; this.mTopItemComponent.Size = this.mItemSize; this.mTopItemComponent.Position = new Vector2( this.mMiddleItemComponent.Position.X, this.mMiddleItemComponent.Position.Y - sItemPadding - this.mItemSize.Y); this.mTopItemComponent.Price = 1; this.mTopItemComponent.Click += this.SelectItemComponent; this.mBottomItemComponent.LoadContent(this.ContentManager); this.mBottomItemComponent.IconTexture = this.mBlankTexture; this.mBottomItemComponent.Size = this.mItemSize; this.mBottomItemComponent.Position = this.mBottomItemComponent.Position = new Vector2( this.mMiddleItemComponent.Position.X, this.mMiddleItemComponent.Position.Y + this.mItemSize.Y + sItemPadding); this.mBottomItemComponent.Price = 3; this.mBottomItemComponent.Click += this.SelectItemComponent; }
private void ConfirmationDialogComponent_Confirm(ConfirmationDialogComponent obj) { var lMetaQueenBee = (MetaQueenBee) this.mSelectedItemComponent.Tag; var lQueenBee = this.mQueenBeeRepository.CreateObject(lMetaQueenBee); this.mPlayerManager.ProcessCoinExchange(-lMetaQueenBee.PurchasePrice); this.mPlayer.QueenBees.Add(lQueenBee); this.mAreQueensLocked = false; }
private void ConfirmationDialogComponent_Cancel(ConfirmationDialogComponent obj) { this.mAreQueensLocked = false; }
private void ConfirmationDialogComponent_Confirm(ConfirmationDialogComponent obj) { }
private void ConfirmationDialogComponent_Confirm(ConfirmationDialogComponent obj) { var lMetaSuper = this.mSelectedItemComponent.Tag as MetaSuper; if (lMetaSuper != null) { var lSuper = this.mSuperRepository.CreateObject(lMetaSuper); this.mPlayerManager.ProcessCoinExchange(-lMetaSuper.PurchasePrice); this.mPlayer.Supers.Add(lSuper); } else { var lMetaSuperPaint = this.mSelectedItemComponent.Tag as MetaSuperPaint; System.Diagnostics.Debug.Assert(lMetaSuperPaint != null); var lSuperPaint = this.mSuperPaintRepository.CreateObject(lMetaSuperPaint); this.mPlayerManager.ProcessCoinExchange(-lMetaSuperPaint.PurchasePrice); this.mPlayer.SuperPaints.Add(lSuperPaint); } this.mAreSuperPaintsLocked = false; }
private void ConfirmationDialogComponent_Cancel(ConfirmationDialogComponent obj) { this.mAreSuperPaintsLocked = false; }
public override void LoadContent() { base.LoadContent(); this.mPlayerManager = this.ScreenManager.BeeWorldManager.PlayerManager; this.mPlayer = this.mPlayerManager.Player; this.mSuperPaintRepository = new SuperPaintRepository(this.ContentManager); this.mSuperRepository = new SuperRepository(this.ContentManager); this.mBlankTexture = this.ContentManager.Load<Texture2D>("Sprites/Blank"); this.mConfirmationDialogComponent = new ConfirmationDialogComponent(this.ScreenSize); this.mConfirmationDialogComponent.LoadContent(this.ContentManager); this.mConfirmationDialogComponent.CancelText = "No"; this.mConfirmationDialogComponent.ConfirmText = "Yes"; this.mConfirmationDialogComponent.Confirm += this.ConfirmationDialogComponent_Confirm; this.mConfirmationDialogComponent.Cancel += this.ConfirmationDialogComponent_Cancel; this.mButtonMenuComponent = new ButtonMenuComponent(this.ScreenSize); this.mButtonMenuComponent.LoadContent(this.ContentManager); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBuy); this.mButtonMenuComponent.MenuButtons.Add(this.mMenuButtonBack); // // mHudComponent // this.mHudComponent = new ShopScreenHudComponent(this.ScreenManager.BeeWorldManager, this.ScreenSize); this.mHudComponent.LoadContent(this.ContentManager); // // mMiddleSuperItemComponent // this.mMiddleSuperItemComponent.LoadContent(this.ContentManager); this.mMiddleSuperItemComponent.IconTexture = this.mBlankTexture; this.mMiddleSuperItemComponent.Size = this.mSuperItemSize; this.mMiddleSuperItemComponent.Position = new Vector2( ((this.ScreenSize.X - this.mSuperItemSize.X - this.mSuperPaintItemSize.X)/2f), ((this.ScreenSize.Y - this.mSuperItemSize.Y - this.mHudComponent.Size.Y)/2f)); this.mMiddleSuperItemComponent.NameText = "Middle"; this.mMiddleSuperItemComponent.DescriptionText = "This is the middle item."; this.mMiddleSuperItemComponent.Price = 2; this.mMiddleSuperItemComponent.Click += this.SelectItemComponent; this.PopulateItemComponent( this.mMiddleSuperItemComponent, this.mSuperRepository.GetMetaObject(1)); this.mTopSuperItemComponent.LoadContent(this.ContentManager); this.mTopSuperItemComponent.IconTexture = this.mBlankTexture; this.mTopSuperItemComponent.Size = this.mSuperItemSize; this.mTopSuperItemComponent.Position = new Vector2( this.mMiddleSuperItemComponent.Position.X, this.mMiddleSuperItemComponent.Position.Y - sItemPadding - this.mSuperItemSize.Y); this.mTopSuperItemComponent.NameText = "Top"; this.mTopSuperItemComponent.DescriptionText = "This is the top item."; this.mTopSuperItemComponent.Price = 1; this.mTopSuperItemComponent.Click += this.SelectItemComponent; this.PopulateItemComponent( this.mTopSuperItemComponent, this.mSuperRepository.GetMetaObject(0)); this.mBottomSuperItemComponent.LoadContent(this.ContentManager); this.mBottomSuperItemComponent.IconTexture = this.mBlankTexture; this.mBottomSuperItemComponent.Size = this.mSuperItemSize; this.mBottomSuperItemComponent.Position = this.mBottomSuperItemComponent.Position = new Vector2( this.mMiddleSuperItemComponent.Position.X, this.mMiddleSuperItemComponent.Position.Y + this.mSuperItemSize.Y + sItemPadding); this.mBottomSuperItemComponent.NameText = "Right"; this.mBottomSuperItemComponent.DescriptionText = "This is the bottom item."; this.mBottomSuperItemComponent.Price = 3; this.mBottomSuperItemComponent.Click += this.SelectItemComponent; this.PopulateItemComponent( this.mBottomSuperItemComponent, this.mSuperRepository.GetMetaObject(2)); this.mTopSuperPaintItemComponent.LoadContent(this.ContentManager); this.mTopSuperPaintItemComponent.IconTexture = this.mBlankTexture; this.mTopSuperPaintItemComponent.Size = this.mSuperPaintItemSize; this.mTopSuperPaintItemComponent.Position = new Vector2( this.mTopSuperItemComponent.Position.X + this.mSuperItemSize.X + sItemPadding, this.mTopSuperItemComponent.Position.Y); this.mTopSuperPaintItemComponent.NameText = "Top"; this.mTopSuperPaintItemComponent.DescriptionText = "This is the top item."; this.mTopSuperPaintItemComponent.Price = 4; this.mTopSuperPaintItemComponent.Click += this.SelectItemComponent; this.mMiddleTopSuperPaintItemComponent.LoadContent(this.ContentManager); this.mMiddleTopSuperPaintItemComponent.IconTexture = this.mBlankTexture; this.mMiddleTopSuperPaintItemComponent.Size = this.mSuperPaintItemSize; this.mMiddleTopSuperPaintItemComponent.Position = new Vector2( this.mTopSuperPaintItemComponent.Position.X, this.mTopSuperPaintItemComponent.Position.Y + this.mSuperPaintItemSize.Y + sItemPadding); this.mMiddleTopSuperPaintItemComponent.NameText = "Middle Top"; this.mMiddleTopSuperPaintItemComponent.DescriptionText = "This is the middle-top item."; this.mMiddleTopSuperPaintItemComponent.Price = 5; this.mMiddleTopSuperPaintItemComponent.Click += this.SelectItemComponent; this.mMiddleBottomSuperPaintItemComponent.LoadContent(this.ContentManager); this.mMiddleBottomSuperPaintItemComponent.IconTexture = this.mBlankTexture; this.mMiddleBottomSuperPaintItemComponent.Size = this.mSuperPaintItemSize; this.mMiddleBottomSuperPaintItemComponent.Position = new Vector2( this.mTopSuperPaintItemComponent.Position.X, this.mMiddleTopSuperPaintItemComponent.Position.Y + this.mSuperPaintItemSize.Y + sItemPadding); this.mMiddleBottomSuperPaintItemComponent.NameText = "Middle Bottom"; this.mMiddleBottomSuperPaintItemComponent.DescriptionText = "This is the middle-bottom item."; this.mMiddleBottomSuperPaintItemComponent.Price = 6; this.mMiddleBottomSuperPaintItemComponent.Click += this.SelectItemComponent; this.mBottomSuperPaintItemComponent.LoadContent(this.ContentManager); this.mBottomSuperPaintItemComponent.IconTexture = this.mBlankTexture; this.mBottomSuperPaintItemComponent.Size = this.mSuperPaintItemSize; this.mBottomSuperPaintItemComponent.Position = new Vector2( this.mTopSuperPaintItemComponent.Position.X, this.mMiddleBottomSuperPaintItemComponent.Position.Y + this.mSuperPaintItemSize.Y + sItemPadding); this.mBottomSuperPaintItemComponent.NameText = "Bottom"; this.mBottomSuperPaintItemComponent.DescriptionText = "This is the bottom item."; this.mBottomSuperPaintItemComponent.Price = 7; this.mBottomSuperPaintItemComponent.Click += this.SelectItemComponent; }