コード例 #1
0
ファイル: CompositeFigure.cs プロジェクト: Alano13/Scene
 public void Move(Point vector)
 {
     foreach (var figure in this.ChildFigures)
     {
         figure.Value.Move(vector);
     }
 }
コード例 #2
0
ファイル: PointTest.cs プロジェクト: Alano13/Scene
        public void SumTest(double x1, double y1, double x2, double y2, double x3, double y3)
        {
            var firstPoint = new Point(x1, y1);
            var secondPoint = new Point(x2, y2);
            var resultPoint = firstPoint + secondPoint;

            Assert.That(resultPoint.X, Is.EqualTo(x3).Within(.0005));
            Assert.That(resultPoint.Y, Is.EqualTo(y3).Within(.0005));
        }
コード例 #3
0
ファイル: PointTest.cs プロジェクト: Alano13/Scene
 public void RotateTest(double x1, double y1, double angle, double x2, double y2)
 {
     var testPoint = new Point(x1, y1);
     var resultPoint = testPoint.Rotate(angle);
     Assert.AreEqual(
         testPoint,
         new Point(x2, y2),
         $"{testPoint.X}:{testPoint.Y} don't equal {resultPoint.X}: {resultPoint.Y} ");
 }
コード例 #4
0
ファイル: CircleFigure.cs プロジェクト: Alano13/Scene
 public void Move(Point vector)
 {
     this.center = (Point)this.center + (Point)vector;
 }
コード例 #5
0
ファイル: CircleFigure.cs プロジェクト: Alano13/Scene
 public CircleFigure(Point center, double radius)
 {
     this.center = center;
     this.radius = radius;
 }
コード例 #6
0
ファイル: PointTest.cs プロジェクト: Alano13/Scene
 public void EqualityTest(double x1, double y1, double x2, double y2)
 {
     var firstPoint = new Point(x1, y1);
     var secondPoint = new Point(x2, y2);
     Assert.IsTrue(firstPoint == secondPoint);
 }
コード例 #7
0
ファイル: MoveFigureCommand.cs プロジェクト: Alano13/Scene
 public MoveFigureCommand(string name, Point vector)
 {
     this.name = name;
     this.vector = vector;
 }
コード例 #8
0
ファイル: ISceneStub.cs プロジェクト: Alano13/Scene
 public void Move(string name, Point vector)
 {
     throw new System.NotImplementedException();
 }