コード例 #1
0
        public void test_can_keep_to_required_length()
        {
            var instance = new nMotionVector();

              instance.MaxLength = 10f;
              instance.Update(0, 0);
              instance.Update(2, 0);
              instance.Update(4, 0);
              instance.Update(6, 0);
              instance.Update(8, 0);
              instance.Update(10, 0);
              instance.Length.ShouldBe(10);

              instance.Update(12, 0);
              instance.Length.ShouldBe(10);
        }
コード例 #2
0
        public void test_can_generate_points_from_small_increments()
        {
            var instance = new nMotionVector();

              instance.SegmentSize = 0.5f;
              instance.MaxLength = 10f;

              for (var i = 0.0f; i < 10.1f; i += 0.01f) {
            instance.Update(0, i);
              }

              nGLine[] points;
              points = instance.Points();

              // +1 for the last segment
              points.Length.ShouldBe(21);
        }
コード例 #3
0
        public void test_can_generate_points()
        {
            var instance = new nMotionVector();

              instance.SegmentSize = 0.5f;
              instance.MaxLength = 10f;

              instance.Update(0, 0);
              instance.Update(2, 0);
              instance.Update(4, 0);
              instance.Update(6, 0);
              instance.Update(8, 0);
              instance.Update(10, 0);

              nGLine[] points;
              points = instance.Points();

              points.Length.ShouldBe(20);
        }
コード例 #4
0
 private void Init()
 {
     _motion = new nMotionVector() {
     MaxLength = MaxLength,
     SegmentSize = SegmentSize
       };
       _trail = new nTrail((int) (MaxLength / SegmentSize)) {
     MinWidth = MinWidth,
     MaxWidth = MaxWidth
       };
       var m = new nMotion(_trail, new ForeverAnim());
       _sprites.Add(m);
       _ready = true;
 }
コード例 #5
0
 public void test_can_create_instance()
 {
     var instance = new nMotionVector();
       instance.ShouldNotBe(null);
 }