/// <summary> /// Write Position data to a binary stream. /// </summary> /// <param name="writer">BinaryWriter positioned at start of Position data.</param> /// <param name="position">RecordPosition data to write.</param> public static void WritePosition(BinaryWriter writer, RecordPosition position) { writer.Write(position.WorldX); writer.Write(position.YOffset); writer.Write(position.YBase); writer.Write(position.WorldZ); }
/// <summary> /// Read RecordPosition data from binary stream. /// </summary> /// <param name="reader">BinaryReader positioned at start of Position data.</param> /// <returns>RecordPosition struct.</returns> public static RecordPosition ReadPosition(BinaryReader reader) { RecordPosition position = new RecordPosition(); position.WorldX = reader.ReadInt32(); position.WorldY = reader.ReadInt32(); position.WorldZ = reader.ReadInt32(); return(position); }
/// <summary> /// Read RecordPosition data from binary stream. /// </summary> /// <param name="reader">BinaryReader positioned at start of Position data.</param> /// <returns>RecordPosition struct.</returns> public static RecordPosition ReadPosition(BinaryReader reader) { RecordPosition position = new RecordPosition(); position.WorldX = reader.ReadInt32(); position.YOffset = reader.ReadUInt16(); position.YBase = reader.ReadUInt16(); position.WorldZ = reader.ReadInt32(); return(position); }
/// <summary> /// Read RecordPosition data from binary stream. /// </summary> /// <param name="reader">BinaryReader positioned at start of Position data.</param> /// <returns>RecordPosition struct.</returns> public static RecordPosition ReadPosition(BinaryReader reader) { RecordPosition position = new RecordPosition(); position.WorldX = reader.ReadInt32(); position.YOffset = reader.ReadUInt16(); position.YBase = reader.ReadUInt16(); position.WorldZ = reader.ReadInt32(); return position; }