コード例 #1
0
        public void DrawCar(Car obj)
        {
            if (_drawLibX != null)
            {
                _drawLibX.DrawCircle(obj.WheelA);
                _drawLibX.DrawCircle(obj.WheelB);
                _drawLibX.DrawRectangle(obj.Body);

                return;
            }

            if (_drawLibY != null)
            {
                _drawLibY.DrawCircle(obj.WheelA.Center.X, obj.WheelA.Center.Y, obj.WheelA.Radius);
                _drawLibY.DrawCircle(obj.WheelB.Center.X, obj.WheelB.Center.Y, obj.WheelB.Radius);

                // All this for drawing a rectangle...
                double brX = obj.Body.BotRight.X;
                double brY = obj.Body.BotRight.Y;
                double tlX = obj.Body.TopLeft.X;
                double tlY = obj.Body.TopLeft.Y;
                _drawLibY.DrawLine(tlX, tlY, brX, tlY);
                _drawLibY.DrawLine(brX, tlY, brX, brY);
                _drawLibY.DrawLine(brX, brY, tlX, brY);
                _drawLibY.DrawLine(tlX, brY, tlX, tlY);

                return;
            }
        }
コード例 #2
0
ファイル: DrawLibXAdapter.cs プロジェクト: perl-easj/OOProg
 public void DrawCircle(Circle obj)
 {
     _drawLibX.DrawCircle(obj);
 }