Exemple #1
0
        private void RenderProc(object obj)
        {
            var tickHelper = new TickHelper(Config.AnimateCycleTime / Config.AnimateFramePerCycle);

            this.outerEvent.Set();

            while (this.renderFlag)
            {
                this.innerEvent.WaitOne();

                this.UpdateBackGround(this.lastContextContainer.GameField);

                for (int i = 0; i < Config.AnimateFramePerCycle; i++)
                {
                    tickHelper.Set();
                    this.UpdateAnimate(i, this.lastContextContainer.GameField, this.lastContextContainer.PlayerCtx);
                    this.mainControl.Update(this.animateImage);
                    foreach (var playerControl in this.playerControlList)
                    {
                        playerControl.UpdateStateImage();
                    }
                    tickHelper.Wait();
                }

                for (int i = 0; i < this.lastContextContainer.PlayerCtx.Count(); i++)
                {
                    this.playerControlList[this.lastContextContainer.PlayerCtx[i].Number].UpdateScore(this.lastContextContainer.PlayerCtx[i].Name, this.lastContextContainer.PlayerCtx[i].Score.ToString(), this.lastContextContainer.PlayerCtx[i].Power.ToString(), this.lastContextContainer.PlayerCtx[i].Stun.ToString());
                }

                this.outerEvent.Set();
            }
        }