private void BuildMember() { if (mObject == null) { return; } IType[] ttypes = mCodeTool.GetFieldTypes(mType); for (int i = 0; i < ttypes.Length; i++) { object tfield = mCodeTool.GetMemberByIndex(mType, i, mObject); BuilderObjectWriterBaseCSLS.BuildChild(mCodeTool, tfield, mWriter); } }
private void BuildMember() { IType[] ttypes = mCodeTool.GetFieldTypes(mScriptType); int tindex = 1; for (int i = 0; i < ttypes.Length; i++) { BuilderObjectBase tobj = BuilderObjectBase.GetMember(mCodeTool, ttypes[i], i, tindex++, mScriptObject, mScriptType); AddMember(tobj); } int tfieldnumber = mReader.ReadFieldHeader(); while (tfieldnumber > 0) { if (!Members.ContainsKey(tfieldnumber)) { throw new InvalidOperationException("ProtoReaderMemberObject 未能从builder中找到对应的字段 fieldnumber:" + tfieldnumber); } BuilderObjectBase tprb = Members[tfieldnumber]; tprb.ReadMember(mReader); tfieldnumber = mReader.ReadFieldHeader(); } }