Exemplo n.º 1
0
        public static UInt8 deserializeSingleInt8(JsonObject juint8)
        {
            //evtl ändern in String -> sbyte, da floatingpointfehler
            double doublebyte = juint8["data"].GetNumber();
            byte   uinteger8  = (byte)doublebyte;

            // Baue den Integer8 zusammen
            UInt8 uint8Object = new UInt8();

            uint8Object.data = uinteger8;
            return(uint8Object);
        }
Exemplo n.º 2
0
        private void UpdateNumbers([NotNull] byte[] pixels, int offset)
        {
            if (pixels == null)
            {
                throw new ArgumentNullException(nameof(pixels));
            }

            if (offset < 0 || offset >= pixels.Length)
            {
                throw new ArgumentOutOfRangeException(nameof(offset));
            }

            Int8     = (sbyte)pixels[offset];
            UInt8    = pixels[offset];
            UInt8Hex = UInt8?.ToStringHex();

            var i16 = pixels.TryGetInt16(offset);
            var i32 = pixels.TryGetInt32(offset);
            var i64 = pixels.TryGetInt64(offset);

            Int16BE = i16?.ToEndian(Endianness.BigEndian);
            Int32BE = i32?.ToEndian(Endianness.BigEndian);
            Int64BE = i64?.ToEndian(Endianness.BigEndian);
            Int16LE = i16?.ToEndian(Endianness.LittleEndian);
            Int32LE = i32?.ToEndian(Endianness.LittleEndian);
            Int64LE = i64?.ToEndian(Endianness.LittleEndian);

            var u16 = pixels.TryGetUInt16(offset);
            var u32 = pixels.TryGetUInt32(offset);
            var u64 = pixels.TryGetUInt64(offset);

            UInt16BE = u16?.ToEndian(Endianness.BigEndian);
            UInt32BE = u32?.ToEndian(Endianness.BigEndian);
            UInt64BE = u64?.ToEndian(Endianness.BigEndian);
            UInt16LE = u16?.ToEndian(Endianness.LittleEndian);
            UInt32LE = u32?.ToEndian(Endianness.LittleEndian);
            UInt64LE = u64?.ToEndian(Endianness.LittleEndian);

            UInt16BEHex = UInt16BE?.ToStringHex();
            UInt32BEHex = UInt32BE?.ToStringHex();
            UInt64BEHex = UInt64BE?.ToStringHex();
            UInt16LEHex = UInt16LE?.ToStringHex();
            UInt32LEHex = UInt32LE?.ToStringHex();
            UInt64LEHex = UInt64LE?.ToStringHex();
        }
Exemplo n.º 3
0
 internal static extern IntPtr CFUUIDGetConstantUUIDWithBytes(
     CFAllocatorRef alloc,
     UInt8 byte0,
     UInt8 byte1,
     UInt8 byte2,
     UInt8 byte3,
     UInt8 byte4,
     UInt8 byte5,
     UInt8 byte6,
     UInt8 byte7,
     UInt8 byte8,
     UInt8 byte9,
     UInt8 byte10,
     UInt8 byte11,
     UInt8 byte12,
     UInt8 byte13,
     UInt8 byte14,
     UInt8 byte15
     );
Exemplo n.º 4
0
 public static Void WriteLine(UInt8 value)
 {
     Internal.Console_WriteUInt8Line(value);
 }
Exemplo n.º 5
0
 private static bool CheckUInt8(UInt8 v)
 {
     return(v == 255);
 }
Exemplo n.º 6
0
        public void Decode(XLua.LuaTable luaTable, BinaryReader stream)
        {
            var dictionary = new Dictionary <String, object>();

            foreach (var v in _attrs)
            {
                try
                {
                    if (v.type.Equals(_sString))
                    {
                        String value = "";
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sInt32))
                    {
                        Int32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sUint32))
                    {
                        UInt32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sEnum))
                    {
                        Int32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sUint8))
                    {
                        UInt8 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sUint16))
                    {
                        UInt16 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }

                    else if (v.type.Equals(_sUint64))
                    {
                        UInt64 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sInt8))
                    {
                        Int8 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sInt16))
                    {
                        Int16 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }

                    else if (v.type.Equals(_sInt64))
                    {
                        Int64 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sDouble))
                    {
                        Double value = 0.0f;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sFloat))
                    {
                        Float value = 0.0f;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(_sBool))
                    {
                        Bool value = false;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else
                    {
                        //var table = _luaEnv.Global.GetInPath<CfgLua>(v.type);
                        //var ml = table.Get<String, CfgLua>(_sSelf);
                        var cl = _luaEnv.Global.GetInPath <CfgLua>(v.type);

                        cl.LoadCfg();

                        var indexValue = ReadValue(stream, cl.IndexType);
                        dictionary.Add(v.name, cl.GetItem(indexValue));
                    }
                }
                catch (Exception e)
                {
                    UnityEngine.Debug.LogException(e);
                }
            }

            luaTable.Set(dictionary);
        }
Exemplo n.º 7
0
 public static UInt8 Min(UInt8 val1, UInt8 val2)
 {
     return(val1 < val2? val1 : val2);
 }
Exemplo n.º 8
0
		internal static extern IntPtr CFUUIDGetConstantUUIDWithBytes (
			CFAllocatorRef alloc,
			UInt8 byte0,
			UInt8 byte1,
			UInt8 byte2,
			UInt8 byte3,
			UInt8 byte4,
			UInt8 byte5,
			UInt8 byte6,
			UInt8 byte7,
			UInt8 byte8,
			UInt8 byte9,
			UInt8 byte10,
			UInt8 byte11,
			UInt8 byte12,
			UInt8 byte13,
			UInt8 byte14,
			UInt8 byte15
			);
 /// <summary>
 /// Converts the specified value to its equivalent string representation.
 /// </summary>
 /// <param name="value">The value to convert.</param>
 /// <returns>
 /// The string representation of <paramref name="value"/>.
 /// </returns>
 /// <remarks>
 /// The <see cref="IFormatProvider"/> specified in the <see cref="NumberStringConverter{T}(NumberStylesParseFunc{T}, NumberStylesTryParseFunc{T}, IFormatProvider)"/>
 /// constructor is passed to the <see cref="IFormattable.ToString(string, IFormatProvider)"/> method to represent <paramref name="value"/>.
 /// </remarks>
 public string ToString(byte value) => UInt8.ToString(value);
Exemplo n.º 10
0
 private static UInt64 TestUInt8ToUInt64Func([ParamFullRange] UInt8 v)
 {
     return((UInt64)v);
 }
Exemplo n.º 11
0
 private static UInt32 TestUInt8ToUInt32Func([ParamFullRange] UInt8 v)
 {
     return((UInt32)v);
 }
Exemplo n.º 12
0
 private static UInt16 TestUInt8ToUInt16Func([ParamFullRange] UInt8 v)
 {
     return((UInt16)v);
 }
Exemplo n.º 13
0
 private static Int8 TestUInt8ToInt8Func([ParamFullRange] UInt8 v)
 {
     return((Int8)v);
 }
Exemplo n.º 14
0
 public static string serializeSingleInt8(UInt8 uinteger8)
 {
     return("{\"uint8\": {\"data\": " + uinteger8.data + "}");
 }
Exemplo n.º 15
0
 private static Single TestUInt8ToSingleFunc([ParamFullRange] UInt8 v)
 {
     return((Single)v);
 }
 /// <summary>
 /// Tries to convert the specified string to a <see cref="byte"/> value.
 /// The return value indicates whether the conversion succeeded or failed.
 /// </summary>
 /// <param name="s">A string containing the value to convert.</param>
 /// <param name="value">When this method returns, if the conversion succeeded, contains the converted value; otherwise <c>0</c> (zero).</param>
 /// <returns><see langword="true"/> if value was converted successfully; otherwise, <see langword="false"/>.</returns>
 /// <seealso cref="NumberStringConverter{T}.TryParse(string, out T)"/>
 public bool TryParse(string s, out byte value) => UInt8.TryParse(s, out value);
Exemplo n.º 17
0
 private static Double TestUInt8ToDoubleFunc([ParamFullRange] UInt8 v)
 {
     return((Double)v);
 }
Exemplo n.º 18
0
 public virtual bool HasMemberInPlane(UInt8 thePlane)
 {
     return(default(bool));
 }
Exemplo n.º 19
0
        public void Decode(XLua.LuaTable luaTable, BinaryReader stream)
        {
            var dictionary = new Dictionary <String, object>();

            foreach (var v in _attrs)
            {
                try
                {
                    if (v.type.Equals(s_sString))
                    {
                        String value = "";
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sInt32))
                    {
                        Int32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sUint32))
                    {
                        UInt32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sEnum))
                    {
                        Int32 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sUint8))
                    {
                        UInt8 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sUint16))
                    {
                        UInt16 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }

                    else if (v.type.Equals(s_sUint64))
                    {
                        UInt64 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sInt8))
                    {
                        Int8 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sInt16))
                    {
                        Int16 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }

                    else if (v.type.Equals(s_sInt64))
                    {
                        Int64 value = 0;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sDouble))
                    {
                        Double value = 0.0f;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sFloat))
                    {
                        Float value = 0.0f;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else if (v.type.Equals(s_sBool))
                    {
                        Bool value = false;
                        doDeserialize(stream, ref value);
                        dictionary.Add(v.name, value);
                    }
                    else
                    {
                        var table = _luaEnv.Global.Get <XLua.LuaTable>(v.name);
                        var ml    = table.Get <String, MessageLua>(s_sSelf);
                        ml.Decode(table, stream);
                    }
                }
                catch (Exception e)
                {
                    UnityEngine.Debug.LogException(e);
                }
            }

            luaTable.Set(dictionary);
        }
Exemplo n.º 20
0
 public static extern Void Console_WriteUInt8Line(UInt8 value);
Exemplo n.º 21
0
        private static object ReadValue(BinaryReader stream, String t)
        {
            if (t.Equals(_sString))
            {
                String value = "";
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sInt32))
            {
                Int32 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sUint32))
            {
                UInt32 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sEnum))
            {
                Int32 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sUint8))
            {
                UInt8 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sUint16))
            {
                UInt16 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sUint64))
            {
                UInt64 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sInt8))
            {
                Int8 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sInt16))
            {
                Int16 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }

            else if (t.Equals(_sInt64))
            {
                Int64 value = 0;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sDouble))
            {
                Double value = 0.0f;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sFloat))
            {
                Float value = 0.0f;
                doDeserialize(stream, ref value);
                return(value);
            }
            else if (t.Equals(_sBool))
            {
                Bool value = false;
                doDeserialize(stream, ref value);
                return(value);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 22
0
 public NSNumber(UInt8 unsignedChar)
 {
 }
Exemplo n.º 23
0
 public static UInt8 Max(UInt8 val1, UInt8 val2)
 {
     return(val1 > val2? val1 : val2);
 }