public static QuestObjective DeserializeObjective(Type[] referenceTable, GenericReader reader) { int encoding = reader.ReadEncodedInt(); switch (encoding) { default: case 0x00: // null { return(null); } case 0x01: { Type type = ReadType(referenceTable, reader); QuestObjective obj = Construct(type) as QuestObjective; if (obj != null) { obj.BaseDeserialize(reader); } return(obj); } } }
public static QuestObjective DeserializeObjective(QuestSystem qs, GenericReader reader) { int encoding = reader.ReadEncodedInt(); switch (encoding) { default: case 0x00: // null { return(null); } case 0x01: // old format { Type type = ReadType(qs, reader); QuestObjective obj = Construct(type) as QuestObjective; if (obj == null) { QuestObjectiveStub.Instance.BaseDeserialize(reader); } else { obj.BaseDeserialize(reader); } return(obj); } case 0x02: { Type type = reader.ReadObjectType(); QuestObjective obj = Construct(type) as QuestObjective; Persistence.DeserializeBlock(reader, r => obj?.BaseDeserialize(r)); return(obj); } } }