コード例 #1
0
        public void ReadOnlySpanToVector2Fix16Test()
        {
            var span = new Fix16[] { (Fix16)4, (Fix16)7 }.ToImmutableArray().AsSpan();
            var vec = span.ToVector2Fix16();

            Assert.That(vec.X, Is.EqualTo(span[0]));
            Assert.That(vec.Y, Is.EqualTo(span[1]));
        }
コード例 #2
0
        public void ArrayToVector2Fix16Test()
        {
            var array = new Fix16[] { (Fix16)4, (Fix16)7 };
            var vec   = array.ToVector2Fix16();

            Assert.That(vec.X, Is.EqualTo(array[0]));
            Assert.That(vec.Y, Is.EqualTo(array[1]));
        }
コード例 #3
0
        public void SpanToVector2Fix16Test()
        {
            var span = new Fix16[] { (Fix16)4, (Fix16)7 }.AsSpan();
            var vec = span.ToVector2Fix16();

            Assert.That(vec.X, Is.EqualTo(span[0]));
            Assert.That(vec.Y, Is.EqualTo(span[1]));
        }