public LargeStruct(MyRandom r) { m_val1 = r.Next(); m_val2 = r.Next(); m_val3 = r.Next(); m_val4 = r.Next(); }
public BoxedPrimitivesMessage(MyRandom r) { m_bool = (r.Next() & 1) == 1; m_byte = (byte)r.Next(); m_int = (int)r.Next(); m_long = (long)r.Next(); m_int = (int)r.Next(); m_enum = (MyEnum)r.Next(0, 6); }
public StringMessage(MyRandom r) { int len = r.Next(100); if (len == 0) { m_string = null; } else { //m_string = new string((char)r.Next(0xD7FF), len - 1); m_string = new string((char)r.Next((int)'a', (int)'z'), len - 1); } }
public DecimalMessage(MyRandom r) { int[] bits = new int[4]; bits[0] = (int)r.Next(); bits[1] = (int)r.Next(); bits[2] = (int)r.Next(); uint exp = ((uint)r.Next(29)) << 16; exp |= ((r.Next() & 1) == 0 ? 0u : 1u) << 31; bits[3] = (int)exp; m_val = new decimal(bits); }
public IntArrayMessage(MyRandom r) { int len = r.Next(100000); if (len == 0) { m_intArr = null; } else { m_intArr = new int[len - 1]; for (int i = 0; i < m_intArr.Length; ++i) { m_intArr[i] = (int)r.Next(); } } }
public CustomSerializersMessage(MyRandom r) { int lx = r.Next(100) + 1; int ly = r.Next(70) + 1; int lz = r.Next(40) + 1; m_int3Arr = new int[lz, ly, lx]; for (int z = 0; z < lz; ++z) { for (int y = 0; y < ly; ++y) { for (int x = 0; x < lx; ++x) { m_int3Arr[z, y, x] = (int)r.Next(); } } } }
public ComplexMessage(MyRandom r) { if (r.Next(100) == 0) { m_msg = null; } else { m_msg = new S16Message(r); } if (r.Next(100) == 0) { m_sealedClass = null; } else { m_sealedClass = new SimpleClass(r); } if (r.Next(100) == 0) { m_abstractMsg = null; } else { m_abstractMsg = new SimpleClass(r); } if (r.Next(100) == 0) { m_ifaceMsg = null; } else { m_ifaceMsg = new SimpleClass2(r); } }
public StructMessage(MyRandom r) { m_struct1.m_byte = (byte)r.Next(); m_struct1.m_int = (int)r.Next(); m_struct1.m_long = (long)r.Next(); m_struct2.m_string = new string((char)r.Next((int)'a', (int)'z'), r.Next(0, 20)); m_struct2.m_int = (int)r.Next(); }
public DictionaryMessage(MyRandom r) { var len = r.Next(0, 1000); if (len > 0) { m_intMap = new Dictionary <int, int>(len); for (int i = 0; i < len; ++i) { m_intMap[(int)r.Next()] = (int)r.Next(); } } len = r.Next(0, 1000); if (len > 0) { m_obMap = new Dictionary <string, SimpleClass2>(); for (int i = 0; i < len; ++i) { var str = i.ToString(); m_obMap[str] = new SimpleClass2(r); } } }
public ByteArrayMessage(MyRandom r) { int len = r.Next(100000); if (len == 0) { m_byteArr = null; } else { m_byteArr = new byte[len - 1]; for (int i = 0; i < m_byteArr.Length; ++i) { m_byteArr[i] = (byte)i; } } }
public NullableDecimalMessage(MyRandom r) { if (r.Next(100) != 0) { return; } int[] bits = new int[4]; bits[0] = (int)r.Next(); bits[1] = (int)r.Next(); bits[2] = (int)r.Next(); uint exp = ((uint)r.Next(29)) << 16; exp |= ((r.Next() & 1) == 0 ? 0u : 1u) << 31; bits[3] = (int)exp; m_val = new decimal(bits); }
public U8Message(MyRandom r) { m_val = (byte)r.Next(); }
public PrimitivesMessage(MyRandom r) { m_bool = (r.Next() & 1) == 1; m_byte = (byte)r.Next(); m_sbyte = (sbyte)r.Next(); m_char = (char)r.Next(); m_ushort = (ushort)r.Next(); m_short = (short)r.Next(); m_uint = (uint)r.Next(); m_int = (int)r.Next(); m_ulong = (ulong)r.Next(); m_long = (long)r.Next(); m_int = (int)r.Next(); m_single = (float)r.NextDouble(); m_double = r.NextDouble(); m_enum = (MyEnum)r.Next(0, 6); m_date = DateTime.Now; }
public StringMessage(MyRandom r) { int len = r.Next(100); if (len == 0) m_string = null; else //m_string = new string((char)r.Next(0xD7FF), len - 1); m_string = new string((char)r.Next((int)'a', (int)'z'), len - 1); }
protected SimpleClassBase(MyRandom r) { m_val = (int)r.Next(); }
public S64Message(MyRandom r) { m_val = (long)r.Next(); }
public SimpleClass(MyRandom r) : base(r) { m_val = (long)r.Next(); }
public S32Message(MyRandom r) { m_val = (int)r.Next(); }
public TriDimArrayCustomSerializersMessage(MyRandom r) { int lx = r.Next(100) + 1; int ly = r.Next(70) + 1; int lz = r.Next(40) + 1; m_int3Arr = new int[lz, ly, lx]; for (int z = 0; z < lz; ++z) for (int y = 0; y < ly; ++y) for (int x = 0; x < lx; ++x) m_int3Arr[z, y, x] = (int)r.Next(); }
public ComplexMessage(MyRandom r) { if (r.Next(100) == 0) m_msg = null; else m_msg = new S16Message(r); if (r.Next(100) == 0) m_sealedClass = null; else m_sealedClass = new SimpleClass(r); if (r.Next(100) == 0) m_abstractMsg = null; else m_abstractMsg = new SimpleClass(r); if (r.Next(100) == 0) m_ifaceMsg = null; else m_ifaceMsg = new SimpleClass2(r); }
public DictionaryMessage(MyRandom r) { var len = r.Next(0, 1000); if (len > 0) { m_intMap = new Dictionary<int, int>(len); for (int i = 0; i < len; ++i) m_intMap[(int)r.Next()] = (int)r.Next(); } len = r.Next(0, 1000); if (len > 0) { m_obMap = new Dictionary<string, SimpleClass2>(); for (int i = 0; i < len; ++i) { var str = i.ToString(); m_obMap[str] = new SimpleClass2(r); } } }
public SimpleClass2(MyRandom r) { m_val = (long)r.Next(); }
public S16Message(MyRandom r) { m_val = (short)r.Next(); }
public ByteArrayMessage(MyRandom r) { int len = r.Next(100000); if (len == 0) { m_byteArr = null; } else { m_byteArr = new byte[len - 1]; for (int i = 0; i < m_byteArr.Length; ++i) m_byteArr[i] = (byte)i; } }
public IntArrayMessage(MyRandom r) { int len = r.Next(100000); if (len == 0) { m_intArr = null; } else { m_intArr = new int[len - 1]; for (int i = 0; i < m_intArr.Length; ++i) m_intArr[i] = (int)r.Next(); } }
public NullableDecimalMessage(MyRandom r) { if (r.Next(100) != 0) return; int[] bits = new int[4]; bits[0] = (int)r.Next(); bits[1] = (int)r.Next(); bits[2] = (int)r.Next(); uint exp = ((uint)r.Next(29)) << 16; exp |= ((r.Next() & 1) == 0 ? 0u : 1u) << 31; bits[3] = (int)exp; m_val = new decimal(bits); }