int Encode (short c, bool a, short v) { uint temp = 0; temp |= (uint)c; temp |= (uint)(a ? 0x8000 : 0); temp |= ((uint)v) << 16; return (int)temp; }