Пример #1
0
        public void Draw(IEnumerable <DDCrash> crashes, I3Color color)
        {
            DDDraw.SetBright(color);

            using (this.MyScreen.Section())
            {
                Queue <IEnumerable <DDCrash> > q = new Queue <IEnumerable <DDCrash> >();

                q.Enqueue(crashes);

                while (1 <= q.Count)
                {
                    foreach (DDCrash crash in q.Dequeue())
                    {
                        switch (crash.Kind)
                        {
                        case DDCrashUtils.Kind_e.NONE:
                            break;

                        case DDCrashUtils.Kind_e.POINT:
                            DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y);
                            DDDraw.DrawSetSize(POINT_WH, POINT_WH);
                            DDDraw.DrawEnd();
                            break;

                        case DDCrashUtils.Kind_e.CIRCLE:
                            DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y);
                            DDDraw.DrawSetSize(crash.R * 2.0, crash.R * 2.0);
                            DDDraw.DrawEnd();
                            break;

                        case DDCrashUtils.Kind_e.RECT:
                            DDDraw.DrawRect(
                                Ground.I.Picture.WhiteBox,
                                crash.Rect.L - DDGround.ICamera.X,
                                crash.Rect.T - DDGround.ICamera.Y,
                                crash.Rect.W,
                                crash.Rect.H
                                );
                            break;

                        case DDCrashUtils.Kind_e.MULTI:
                            q.Enqueue(crash.Crashes);
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                }
            }
            DDDraw.Reset();
        }