public void CopyToBuffer(NetNavi_Network_Type n, byte[] b, int index = 0) { n.Program_Step = BitConverter.ToUInt64(b, index); index += 8; n.NAVIEXEID = BitConverter.ToUInt64(b, index); index += 8; n.NaviID = (Navi_Name_ID)BitConverter.ToInt32(b, index); index += 4; n.Location.X = BitConverter.ToSingle(b, index); index += 4; n.Location.Y = BitConverter.ToSingle(b, index); index += 4; n.Speed.X = BitConverter.ToSingle(b, index); index += 4; n.Speed.Y = BitConverter.ToSingle(b, index); index += 4; n.Scale = BitConverter.ToSingle(b, index); index += 4; n.Sprite.X = BitConverter.ToInt32(b, index); index += 4; n.Sprite.Y = BitConverter.ToInt32(b, index); index += 4; n.Health = BitConverter.ToInt32(b, index); index += 4; n.Energy = BitConverter.ToInt32(b, index); index += 4; n.Activated_Ability = BitConverter.ToInt32(b, index); index += 4; n.OnGround = BitConverter.ToBoolean(b, index); index += 1; n.FaceLeft = BitConverter.ToBoolean(b, index); index += 1; n.Running = BitConverter.ToBoolean(b, index); index += 1; n.Jumping = BitConverter.ToBoolean(b, index); index += 1; n.HasJumped = BitConverter.ToBoolean(b, index); index += 1; n.Shooting = BitConverter.ToBoolean(b, index); index += 1; n.WallGrabing = BitConverter.ToBoolean(b, index); index += 1; n.Dashing = BitConverter.ToBoolean(b, index); index += 1; n.HasDashed = BitConverter.ToBoolean(b, index); index += 1; }
public void write_netBuffer(byte[] b, int index = 0) { NetNavi_Network_Type buffer = new NetNavi_Network_Type(); CopyToBuffer(buffer, b, index); NetBuffer.Enqueue(buffer); }
public void CopyToNavi(NetNavi_Network_Type b) { Program_Step = b.Program_Step; NAVIEXEID = b.NAVIEXEID; NaviID = b.NaviID; Location = b.Location; Speed = b.Speed; Scale = b.Scale; Sprite = b.Sprite; Health = b.Health; Energy = b.Energy; Activated_Ability = b.Activated_Ability; OnGround = b.OnGround; FaceLeft = b.FaceLeft; Running = b.Running; Jumping = b.Jumping; HasJumped = b.HasJumped; Shooting = b.Shooting; WallGrabing = b.WallGrabing; Dashing = b.Dashing; HasDashed = b.HasDashed; }