private static void InitSpriteTile(int i) { var temp = new Byte1(); temp.adress = ((AddressSetup)Memory[i + 1]); SpriteTile.Add(temp); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { return((Byte1.GetHashCode() * 397) ^ Byte2.GetHashCode()); } }
public AMask(Byte1 byte1 = Byte1.None, Byte2 byte2 = Byte2.None, Byte3 byte3 = Byte3.None, Byte4 byte4 = Byte4.None) { Mask = (AMaskValues)(((int)byte1 << 8 * 3) | ((int)byte2 << 8 * 2) | ((int)byte3 << 8 * 1) | ((int)byte4)); }
public FMask(Byte1 byte1 = Byte1.None, Byte2 byte2 = Byte2.None, Byte3 byte3 = Byte3.None, Byte4 byte4 = Byte4.None, Byte5 byte5 = Byte5.None) { Mask = (FMaskValues)(((long)byte1 << 8 * 4) | ((long)byte2 << 8 * 3) | ((long)byte3 << 8 * 2) | ((long)byte4 << 8) | ((long)byte5)); }
public override int GetHashCode() { unchecked { int hashCode = Byte1.GetHashCode(); hashCode = (hashCode * 397) ^ Byte2.GetHashCode(); hashCode = (hashCode * 397) ^ Byte3.GetHashCode(); hashCode = (hashCode * 397) ^ Byte4.GetHashCode(); return(hashCode); } }
public AMask(Byte1 byte1 = Byte1.None, Byte2 byte2 = Byte2.None, Byte3 byte3 = Byte3.None, Byte4 byte4 = Byte4.None, Byte5 byte5 = Byte5.None, Byte6 byte6 = Byte6.None, Byte7 byte7 = Byte7.None) { Mask = (AMaskValues) ((ulong)byte1 << 8 * 6 | (ulong)byte2 << 8 * 5 | (ulong)byte3 << 8 * 4 | (ulong)byte4 << 8 * 3 | (ulong)byte5 << 8 * 2 | (ulong)byte6 << 8 * 1 | (ulong)byte7 << 8 * 0); }
unsafe void testSizeof() { Debug.Log(sizeof(Byte1)); Debug.Log(sizeof(Byte2)); Debug.Log(sizeof(Byte4)); Debug.Log(sizeof(Byte8)); Debug.Log(sizeof(Byte16)); Debug.Log(sizeof(Byte32)); Debug.Log(sizeof(Byte64)); Debug.Log(sizeof(Byte128)); Debug.Log(sizeof(Byte256)); Debug.Log(sizeof(Byte512)); Debug.Log(sizeof(Byte1024)); Debug.Log(sizeof(Byte2048)); Debug.Log(sizeof(Byte4096)); Debug.Log(sizeof(Byte8192)); var a1 = new Byte1[2]; var a2 = new Byte2[2]; var a4 = new Byte4[2]; var a8 = new Byte8[2]; var a16 = new Byte16[2]; var a32 = new Byte32[2]; var a64 = new Byte64[2]; var a128 = new Byte128[2]; var a256 = new Byte256[2]; var a512 = new Byte512[2]; var a1024 = new Byte1024[2]; var a2048 = new Byte2048[2]; var a4096 = new Byte4096[2]; var a8192 = new Byte8192[2]; fixed(Byte1 *ptr = a1) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte2 *ptr = a2) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte4 *ptr = a4) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte8 *ptr = a8) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte16 *ptr = a16) { Debug.Log((int)(ptr + 1) - (int)ptr); }; fixed(Byte32 *ptr = a32) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte64 *ptr = a64) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte128 *ptr = a128) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte256 *ptr = a256) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte512 *ptr = a512) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte1024 *ptr = a1024) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte2048 *ptr = a2048) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte4096 *ptr = a4096) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte8192 *ptr = a8192) { Debug.Log((int)(ptr + 1) - (int)ptr); } fixed(Byte8192 *ptr = a8192) { Byte16 *ptr2 = (Byte16 *)ptr; Debug.Log((int)(ptr2 + 1) - (int)ptr2); } }
public override string ToString() { return(CenterX.ToString() + ", " + CenterY.ToString() + ", " + SizeX.ToString() + ", " + SizeY.ToString() + ", " + NodeIndex.ToString() + ", " + NodeCount.ToString() + ", " + Short7.ToString() + ", " + Short8.ToString() + ", " + FloatUtil.ToString(Float1) + ", " + Byte1.ToString() + ", " + Byte2.ToString() + ", " + Byte3.ToString() + ", " + Byte4.ToString()); }
/// <summary> /// 转为T28181云台控制命令 /// </summary> /// <returns></returns> public override string ToString() { return(Byte1.ToString("X2") + Byte2.ToString("X2") + Byte3.ToString("X2") + Byte4.ToString("X2") + Byte5.ToString("X2") + Byte6.ToString("X2") + Byte7.ToString("X2") + Byte8.ToString("X2")); }