Esempio n. 1
0
        public static DumpItem KV(DumpItem d, string name, Vector4 x)
        {
            var subDI = d.GetOrCreateSubitem(name);

            subDI.DumpVector4(x);
            return(subDI);
        }
Esempio n. 2
0
        public static DumpItem KV(DumpItem d, string name, IList <Vector3> x)
        {
            var subDI = d.GetOrCreateSubitem(name);

            DumpList(subDI, x);
            return(subDI);
        }
Esempio n. 3
0
        public static DumpItem KV <T>(DumpItem d, string name, ref T x) where T : IDumpable
        {
            var subDI = d.GetOrCreateSubitem(name);

            x.Dump(subDI);
            return(subDI);
        }
Esempio n. 4
0
        public static DumpItem KV <T>(DumpItem d, string name, IList <T> x) where T : IDumpable
        {
            var subDI = d.GetOrCreateSubitem(name);

            DumpList(subDI, x);
            return(subDI);
        }
Esempio n. 5
0
        public static DumpItem KV(DumpItem d, string name, bool x)
        {
            var   subDI = d.GetOrCreateSubitem(name);
            Int64 tmp   = x ? 1 : 0;

            subDI.DumpInt(tmp);
            return(subDI);
        }
Esempio n. 6
0
        public static DumpItem KV(DumpItem d, string name, Quaternion x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = new Quaternion(x.X, x.Y, x.Z, x.W);

            subDI.DumpQuaternion(tmp);
            return(subDI);
        }
Esempio n. 7
0
        public static DumpItem KV(DumpItem d, string name, Vector2 x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = new Vector4(x.X, x.Y, 0, 0);

            subDI.DumpVector4(tmp);
            return(subDI);
        }
Esempio n. 8
0
        public static DumpItem KV(DumpItem d, string name, float x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = (double)x;

            subDI.DumpDouble(tmp);
            return(subDI);
        }
Esempio n. 9
0
        public static DumpItem KV(DumpItem d, string name, byte x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = (Int64)x;

            subDI.DumpInt(tmp);
            return(subDI);
        }
Esempio n. 10
0
        public static DumpItem KV(DumpItem d, string name, ref UInt64 x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = (Int64)x;
            var wb    = subDI.DumpInt(ref tmp);

            x = (UInt64)tmp;
            return(subDI);
        }
Esempio n. 11
0
        public static DumpItem KV(DumpItem d, string name, ref Int64 x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var wb    = subDI.DumpInt(ref x);

            if (wb)
            {
                subDI.OnWriteBackAction?.Invoke();
            }
            return(subDI);
        }
Esempio n. 12
0
        public static void DumpList <T>(DumpItem d, IList <T> x) where T : IDumpable
        {
            int a_from, a_to;

            Array(d, x.Count, out a_from, out a_to, "Array of " + typeof(T).Name);

            for (int i = a_from; i <= a_to; i++)
            {
                KV(d, String.Empty, x[i]).ArrayIndex = i;
            }

            d.RemoveExtraSubitems();
        }
Esempio n. 13
0
        public static DumpItem KV(DumpItem d, string name, ref Vector2 x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = new Vector4(x.X, x.Y, 0, 0);
            var wb    = subDI.DumpVector4(ref tmp);

            x = new Vector2(tmp.X, tmp.Y);
            if (wb)
            {
                subDI.OnWriteBackAction?.Invoke();
            }
            return(subDI);
        }
Esempio n. 14
0
        public static DumpItem KV(DumpItem d, string name, ref float x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = (double)x;
            var wb    = subDI.DumpDouble(ref tmp);

            x = (float)tmp;
            if (wb)
            {
                subDI.OnWriteBackAction?.Invoke();
            }
            return(subDI);
        }
Esempio n. 15
0
        public static DumpItem KV(DumpItem d, string name, ref Quaternion x)
        {
            var subDI = d.GetOrCreateSubitem(name);
            var tmp   = new Quaternion(x.X, x.Y, x.Z, x.W);
            var wb    = subDI.DumpQuaternion(ref tmp);

            x = new Quaternion(tmp.X, tmp.Y, tmp.Z, tmp.W);
            if (wb)
            {
                subDI.OnWriteBackAction?.Invoke();
            }
            return(subDI);
        }
Esempio n. 16
0
        public static DumpItem KV(DumpItem d, string name, ref byte x)
        {
            var   subDI = d.GetOrCreateSubitem(name);
            Int64 tmp   = x;
            var   wb    = subDI.DumpInt(ref tmp);

            x = (byte)tmp;
            if (wb)
            {
                subDI.OnWriteBackAction?.Invoke();
            }
            return(subDI);
        }
Esempio n. 17
0
        public static void DumpList(DumpItem d, IList <Vector3> x)
        {
            int a_from, a_to;

            Array(d, x.Count, out a_from, out a_to);

            for (int i = a_from; i <= a_to; i++)
            {
                KV(d, String.Empty, x[i]).ArrayIndex = i;
            }

            d.RemoveExtraSubitems();
        }
Esempio n. 18
0
        public static void Array(DumpItem d, int count, out int a_from, out int a_to, string typeName = "Array")
        {
            d.SetupHeader(EDIType.Array, typeName);

            d.ArraySize = count;

            int a_size = ( int )count;

            a_from = System.Math.Min(d.ArrayShowFrom, a_size - 1);
            if (a_from < 0)
            {
                a_from = 0;
            }
            a_to = d.ArrayShowTo < 0 ? a_size - 1 : System.Math.Min(d.ArrayShowTo, a_size - 1);
        }
Esempio n. 19
0
        public DumpItem GetOrCreateSubitem(string name)
        {
            int index = _i++;

            // extend the Children array if not big enough, init the new items to null
            ChildrenExtend(index);

            DumpItem subDI = ChildrenGetAt(index);

            if (subDI == null)
            {
                subDI      = CreateDI();
                subDI.Name = name;
                ChildrenSetAt(index, subDI);
            }

            return(subDI);
        }
Esempio n. 20
0
        /// <summary>
        /// Creates new DI linked to same topic	- a shortcut for "new DumpItem(this.Topic)"
        /// (saves one PInvoke call and one topic wrapper creation)
        /// </summary>
        /// <returns></returns>
        public DumpItem CreateDI()
        {
            var newDI = new DumpItem(Topic);

            return(newDI);
        }
Esempio n. 21
0
 public void ChildrenSetAt(int index, DumpItem di)
 {
     Children[index] = di;
 }
Esempio n. 22
0
 public static void Struct(DumpItem d, string name)
 {
     d.SetupHeader(EDIType.Struct, name);
 }