Esempio n. 1
0
        public static F3DZEXTriangleWrapper GetTriangleWrapper(F3DZEX_G_Tri1 triangle)
        {
            if (_triangleWrappers.ContainsKey(triangle))
                return _triangleWrappers[triangle];

            F3DZEXTriangleWrapper wrapper = new F3DZEXTriangleWrapper(triangle);
            _triangleWrappers.Add(triangle, wrapper);

            return wrapper;
        }
 public F3DZEXTriangleWrapper(F3DZEX_G_Tri1 triangle)
 {
     Mode = TriangleMode.Single;
     SingleTriangle = triangle;
 }
Esempio n. 3
0
        public void TestF3DZEX_G_Tri1()
        {
            //053A3C3E 00000000
            byte[] testVal = new byte[] { 0x05, 0x3A, 0x3C, 0x3E, 0x00, 0x00, 0x00, 0x00 };

            F3DZEX_G_Tri1 cmd = new F3DZEX_G_Tri1(0, testVal);

            byte[] outVal = cmd.RawData;

            Assert.AreEqual(testVal.Length, outVal.Length);
            Assert.IsTrue(Enumerable.SequenceEqual(testVal, outVal));
            Assert.IsTrue(cmd.IsValid);

            //053A3C3E FFFFFFFF
            testVal = new byte[] { 0x05, 0x3A, 0x3C, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF };

            cmd.RawData = testVal;

            byte[] outVal2 = cmd.RawData;

            Assert.AreEqual(outVal.Length, outVal2.Length);
            Assert.IsTrue(Enumerable.SequenceEqual(outVal, outVal2));
            Assert.IsTrue(cmd.IsValid);
        }