Example #1
0
        public void Play()  //It is a game, after all
        {
            objectList = Messenger.GetNewData();
            if (objectList[0].TheStatus == StatusMessage.GraphicsUpdate)
            {
                this.BeginInvoke(new PrintBossHealth(printBossHealth), new object[] { objectList[0].BossHealth });
                Render();
                inputList = new List <DataPacket>();
                inputList.Add(new DataPacket(Direction.Undefined, StatusMessage.RenderFinished));
                Messenger.SendData(inputList);
            }
            else
            {
                switch (objectList[0].TheStatus)
                {
                case StatusMessage.Defeat:
                    Graphics.DidWeWin(false);
                    Messenger.Dispose();
                    break;

                case StatusMessage.Victory:
                    Graphics.DidWeWin(true);
                    Messenger.Dispose();
                    break;
                }
            }
        }