Beispiel #1
0
        public MWmarioGame(ViewManager viewManager)
            : base(viewManager)
        {
            _mariosideBar     = new MWSideBarMarioUpdate(_viewManager);
            _marioservingArea = new MWMarioServingArea();
            _mariobtmBar      = new MWBottomBar();

            _mariogiveUpButton = new MWButton("blue_button07.png");
            _mariogiveUpButton.SetWidth(80);
            _mariogiveUpButton.SetHeight(80);
            _mariogiveUpButton.SetText("Exit", 35);

            //Register for Observer Pattern
            foreach (MWMarioDiningTable diningTable in _marioservingArea.DiningTable)
            {
                diningTable.RegisterSideBar(_mariosideBar);
            }
            _mariobtmBar.RegisterStove(_marioservingArea.Stoves);
            _marioservingArea.Player.RegisterHoldingFrame(_mariosideBar.HoldingFoodFrame);
            //
        }
 // register side bar to show decreased game life
 /// <summary>
 /// Michael Added
 /// </summary>
 /// <param name="sideBar">Side bar.</param>
 public void RegisterSideBar(MWSideBarMarioUpdate sidebarupdate)
 {
     _mariosideBar = sidebarupdate;
 }