public bool loadReader(EexBinaryReader reader) { flag = reader.readFixString(4); short1 = reader.readUShort(); short2 = reader.readUShort(); short3 = reader.readUShort(); return(true); }
public bool loadReader(EexBinaryReader reader) { commandList.Clear(); int sectionCount = reader.readUShort(); int buildTreeCmd = -1; for (int i = 0; i < sectionCount; i++) { int cmdId = reader.readUShort(); ScriptCommand cmd = ScriptCommand.createCommand(cmdId); cmd.loadReader(reader); commandList.Add(cmd); if (buildTreeCmd != -1) { if ((buildTreeCmd == (int)CommandId.CMD_CHILD_INFO_ACTION && cmdId == (int)CommandId.CMD_ACTION_END) || (buildTreeCmd == (int)CommandId.CMD_CHILD_ACTION)) { buildTreeCmd = -1; cmd.setExtValue(reader.readUShort()); continue; } } switch (cmdId) { case (int)CommandId.CMD_CHILD_ACTION: // = 0x1;//子事件设定 case (int)CommandId.CMD_CHILD_INFO_ACTION: // = 0x2;//子事件设定带信息 buildTreeCmd = cmdId; break; default: break; } } return(true); }
public bool loadReader(EexBinaryReader reader) { sectionList.Clear(); int sectionNum = reader.readUShort(); for (int j = 0; j < sectionNum; j++) { ScriptSection section = new ScriptSection(); section.loadReader(reader); sectionList.Add(section); } return(true); }
public override bool loadReader(EexBinaryReader reader) { CommandConfig cfg = ScriptConfig.Instance.getCommandConfig(id); if (cfg.useFieldIds()) { if (cfg.FieldRepeat <= 1) { for (int i = 0; i < fieldCount; i++) { values[i] = reader.readFieldObject(keys[i]); } } else { for (int i = 0; i < cfg.FieldRepeat; i++) { Object[] objs = new Object[fieldCount]; for (int j = 0; j < fieldCount; j++) { objs[j] = reader.readFieldObject(keys[j]); } arrayValues[i] = objs; } } } else { StringBuilder sb = new StringBuilder(); for (int i = 0; i < fieldCount; i++) { sb.Append("0x").Append(reader.readUShort().ToString("x2")).Append(","); values[i] = reader.readFieldValue(cfg.FieldTypes[i]); } String sth = sb.ToString(); Console.WriteLine(sth); MessageBox.Show(sth); } return(true); }