Ejemplo n.º 1
0
        public override void LoadContent()
        {
            base.LoadContent();

            this.mBlankTexture = this.ContentManager.Load<Texture2D>("Sprites/Blank");
            this.mMetaInfoFont = this.ContentManager.Load<SpriteFont>("Fonts/DefaultTiny");
            this.mSuperRepository = new SuperRepository(this.ContentManager);

            this.mButtonBeeWorld.Click += this.ButtonBeeWorld_Click;
            this.mButtonBeeWorld.Font = this.ContentManager.Load<SpriteFont>("Fonts/DefaultSmall");
            this.mButtonBeeWorld.Text = "World";
            this.mButtonBeeWorld.TextColor = Color.White;
            this.mButtonBeeWorld.BackgroundRenderer = new SolidBackgroundRenderer(this.mBlankTexture, Color.Blue);
            this.mButtonBeeWorld.Size = new Vector2(75, 30);
            this.mButtonBeeWorld.Position = new Vector2(10, this.ScreenSize.Y - this.mButtonBeeWorld.Size.Y - 10);

            this.mButtonMowGrass.Click += this.ButtonMowGrass_Click;
            this.mButtonMowGrass.Font = this.ContentManager.Load<SpriteFont>("Fonts/DefaultSmall");
            this.mButtonMowGrass.Text = "Mow Grass";
            this.mButtonMowGrass.TextColor = Color.Black;
            this.mButtonMowGrass.BackgroundRenderer = new SolidBackgroundRenderer(this.mBlankTexture, Color.Yellow);
            this.mButtonMowGrass.Size = new Vector2(100, 35);
            this.mButtonMowGrass.Position = new Vector2(this.ScreenSize.X - this.mButtonMowGrass.Size.X - 10, 10);

            this.mPlayer = this.ScreenManager.Player;
            System.Diagnostics.Debug.Assert(this.mPlayer.CurrentBeeHive == null);
            System.Diagnostics.Debug.Assert(this.mPlayer.CurrentBeeYard != null);
            this.mBeeYard = this.mPlayer.CurrentBeeYard;
            this.mBeeYardManager = this.ScreenManager.BeeWorldManager.PlayerManager.BeeYardManagers[this.mBeeYard.Id];

            var lAssetName = string.Concat("GraphicsData/BeeYard/HiveInformation_", this.mBeeYard.Id);
            var lHiveInfos = this.ContentManager.Load<BeeYardHiveInfo[]>(lAssetName);

            this.mHiveComponents = new BeeYardHiveComponent[lHiveInfos.Length];
            var lGreenBackgroundRenderer = new SolidBackgroundRenderer(this.mBlankTexture, Color.Green);

            for (int lIndex = 0; lIndex < this.mHiveComponents.Length; lIndex++)
            {
                var lHiveComponent = new BeeYardHiveComponent(
                    this.mBlankTexture,
                    this.mBeeYard.BeeHives[lIndex],
                    lHiveInfos[lIndex],
                    this.mSuperRepository);
                lHiveComponent.TravelToHive += this.HiveComponent_TravelToHive;

                this.mHiveComponents[lIndex] = lHiveComponent;
            }

            this.mHudComponent = new BeeYardHubComponent(this.ScreenManager.BeeWorldManager, this.ScreenSize);
            this.mHudComponent.LoadContent(this.ContentManager);
        }
Ejemplo n.º 2
0
        private void HiveComponent_TravelToHive(BeeYardHiveComponent hiveComponent)
        {
            var lBeeHive = hiveComponent.BeeHive;
            var lPlayerManager = this.ScreenManager.BeeWorldManager.PlayerManager;
            lPlayerManager.TravelTo(lBeeHive);

            var lHiveScreen = new BeeHiveScreen();
            this.ScreenManager.TransitionTo(lHiveScreen);
        }