void WriteField(DatWriter w, JField field) { w.WriteUInt8((byte)field.type); w.WriteUtf8(field.field); if (field.klass == null) { return; } w.WriteUInt8(TC_STRING); w.WriteUtf8(field.klass); }
void WriteClassDesc(DatWriter w, string klass, JField[] fields) { // Write serialised Level Object w.WriteUInt8(TC_CLASSDESC); w.WriteUtf8(klass); w.WriteInt32(0); w.WriteInt32(0); // serialUUID w.WriteUInt8(SC_SERIALIZABLE); // SC_SERIALIZABLE w.WriteUInt16((ushort)fields.Length); foreach (JField field in fields) { WriteField(w, field); } w.WriteUInt8(TC_ENDOFBLOCKDATA); // classAnnotations w.WriteUInt8(TC_NULL); // superClassDesc }