示例#1
0
        public void PropertyCanReadNoneValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x1E1 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "None");
            Assert.AreEqual(Prop.Value, null);
            Assert.AreEqual(Prop.Size, 1);
            Assert.AreEqual(Prop.Type, PropertyType.None);
        }
示例#2
0
        public void PropertyCanReadBoolValueTest()
        {
            //Alloc
            string name           = "StaticMeshActor0";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 19 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "bDynamicActorFilterState");
            Assert.IsTrue((bool)Prop.Value);
            Assert.AreEqual(Prop.Size, 3);
        }
示例#3
0
        public void PropertyCanReadStructValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x97 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "SpinCCWorCW");
            Assert.IsTrue(Prop.Value is byte[]);
            Assert.AreEqual(Prop.Size, 16);
            Assert.AreEqual(Prop.Type, PropertyType.StructProperty);
        }
示例#4
0
        public void PropertyCanReadStrValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x7E + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "Name");
            Assert.IsTrue(Prop.Value is string);
            Assert.AreEqual(Prop.Size, 21);
            Assert.AreEqual(Prop.Value, "SpriteEmitter29");
        }
示例#5
0
        public void PropertyCanReadFloatValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x5A + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "Opacity");
            Assert.IsTrue(Prop.Value is float);
            Assert.AreEqual(Prop.Size, 7);
            Assert.AreEqual(Prop.Value, 0.34f);
        }
示例#6
0
        private static void RE_Check_OffsetDeltaIsConstant() // false
        {
            string name1 = "MeshEmitter0";
            //Export Exp1 = ExportTable.Find(NameTable.IndexOf(name1));
            Export Exp1        = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name1))?.First();
            int    RealOffset1 = 0x044C32;

            string name2 = "MeshEmitter25";
            //Export Exp2 = ExportTable.Find(NameTable.IndexOf(name2));
            Export Exp2        = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name2))?.First();
            int    RealOffset2 = 0x0450F9;

            Console.WriteLine("{0:X} - {1:X} = {2:X}", RealOffset1, (int)Exp1.SerialOffset, RealOffset1 - Exp1.SerialOffset);
            Console.WriteLine("{0:X} - {1:X} = {2:X}", RealOffset2, (int)Exp2.SerialOffset, RealOffset2 - Exp2.SerialOffset);
        }
示例#7
0
        public void PropertyCanReadIntegerValueTest()
        {
            string name = "SpriteEmitter544";
            //Export Exp = ExportTable.Find(NameTable.IndexOf(name));
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x77 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "MaxParticles");
            Assert.IsTrue(Prop.Value is int);
            Assert.AreEqual(Prop.Size, 7);
            Assert.AreEqual(Prop.Value, 0x02);
        }
示例#8
0
        public void PropertyCanReadByteValueTest()
        {
            //0x017F
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x017F + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "DrawStyle");
            Assert.IsTrue(Prop.Value is byte);
            Assert.AreEqual(Prop.Size, 4);
            Assert.AreEqual(Prop.Value, (byte)0x06);
        }
示例#9
0
        public void PropertyCanReadObjectIndexValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x183 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "Texture");
            Assert.IsTrue(Prop.Value is Index);
            Assert.AreEqual(Prop.Size, 5);
            Index val = Prop.Value as Index;

            Assert.AreEqual(val.Value, -105);
        }
示例#10
0
        public void PropertyCanReadStructPointRegionValueTest()
        {
            string name           = "StaticMeshActor1";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x19 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);

            Prop.SetStructType(StructType.PointRegion);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "Region");
            Assert.IsTrue(Prop.Value is DataStructures.UPointRegion);
            Assert.AreEqual(Prop.Size, 17);
            DataStructures.UPointRegion ur = Prop.Value as DataStructures.UPointRegion;
            Assert.AreEqual(ur.iLeaf, 725);
            Assert.AreEqual(ur.ZoneNumber, (byte)1);
            Assert.AreEqual(ur.Zone.Value, 0x04);
        }
示例#11
0
        public void PropertyCanReadStructColorValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x0B + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);

            Prop.SetStructType(StructType.Color);
            UColor Col = Prop.Value as UColor;

            //Assert
            Assert.IsTrue(Prop.Value is UColor);
            Assert.AreEqual(Prop.Size, 7);
            Assert.AreEqual(Prop.NameTableRef.Value, NameTable.IndexOf("Color"));
            Assert.AreEqual((byte)255, Col.a);
            Assert.AreEqual((byte)255, Col.b);
            Assert.AreEqual((byte)255, Col.g);
            Assert.AreEqual((byte)255, Col.r);
        }
示例#12
0
        public void PropertyCanReadStructRotatorValueTest()
        {
            string name           = "StaticMeshActor2";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x42 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);

            Prop.SetStructType(StructType.Rotator);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "Rotation");
            Assert.IsTrue(Prop.Value is DataStructures.URotator);
            Assert.AreEqual(Prop.Size, 15);
            DataStructures.URotator ur = Prop.Value as DataStructures.URotator;
            Assert.AreEqual(ur.Pitch, 0);
            Assert.AreEqual(ur.Yaw, 2048);
            Assert.AreEqual(ur.Roll, 0);
        }
示例#13
0
        public void PropertyCanReadStructVectorValueTest()
        {
            string name           = "SpriteEmitter544";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x97 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);

            Prop.SetStructType(StructType.Vector);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "SpinCCWorCW");
            Assert.IsTrue(Prop.Value is DataStructures.UVector);
            Assert.AreEqual(Prop.Size, 16);
            DataStructures.UVector uv = Prop.Value as DataStructures.UVector;
            Assert.AreEqual(Prop.Type, PropertyType.StructProperty);
            Assert.AreEqual(uv.X, 1.00f);
            Assert.AreEqual(uv.Y, 0.50f);
            Assert.AreEqual(uv.Z, 0.50f);
        }
示例#14
0
        public void PropertyCanReadArrayValueTest()
        {
            string          name           = "SpriteEmitter544";
            Export          Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int             PropertyOffset = 0 + Exp.SerialOffset + 28;
            List <Property> Val;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "ColorScale");
            Assert.IsTrue(Prop.Value is List <Property>);
            Assert.AreEqual(Prop.Size, 33);
            Assert.AreEqual(Prop.Type, PropertyType.ArrayProperty);

            //Act more
            Val = Prop.Value as List <Property>;
            //Assert more
            Assert.AreEqual(6, Val.Count());
        }
示例#15
0
        public void PropertyCanReadStructScaleValueTest()
        {
            string name           = "Brush192";
            Export Exp            = ExportTable.FindAll(n => n.NameTableRef == NameTable.IndexOf(name))?.First();
            int    PropertyOffset = 0x13 + Exp.SerialOffset + 28;
            //Act
            Property Prop = new Property(pf.Bytes, PropertyOffset);

            Prop.SetStructType(StructType.Scale);
            //Assert
            string Str = NameTable[Prop.NameTableRef];

            Assert.AreEqual(Str, "MainScale");
            Assert.IsTrue(Prop.Value is DataStructures.UScale);
            Assert.AreEqual(Prop.Size, 30);
            DataStructures.UScale us = Prop.Value as DataStructures.UScale;
            Assert.AreEqual(us.x, 1.0f);
            Assert.AreEqual(us.y, 1.0f);
            Assert.AreEqual(us.z, 1.0f);
            Assert.AreEqual(us.sheerrate, 0.0f);
            Assert.AreEqual(us.sheeraxis, 5);
        }