public bool loadReader(EexBinaryReader reader, int group) { header.loadReader(reader); sceneList.Clear(); cmdIndexList.Clear(); int sceneNum = (reader.readInt32() - 10) / 4; for (int i = 0; i < sceneNum; i++) { reader.setIndex(10 + i * 4); int pos = reader.readInt32(); reader.setIndex(pos); cmdIndexList.Add(pos); ScriptScene scene = new ScriptScene(); scene.loadReader(reader, group); sceneList.Add(scene); foreach (int index in scene.cmdIndexList) { cmdIndexList.Add(index); } } CorrectCmdData(true); return(true); }
public bool loadJson(JObject jobj) { header.loadJson((JObject)jobj["header"]); sceneList.Clear(); JArray jar = (JArray)jobj["scenes"]; foreach (JObject item in jar) { ScriptScene sce = new ScriptScene(); sce.loadJson(item); sceneList.Add(sce); } return(true); }
public void saveNewWriter(EexBinaryWriter writer) { header.saveWriter(writer); writer.setIndex(10 + sceneList.Count * 4); for (int i = 0; i < sceneList.Count; i++) { int wIndex = writer.getIndex(); writer.setIndex(10 + i * 4); writer.writeInt32(wIndex); writer.setIndex(wIndex); ScriptScene item = sceneList[i]; item.saveNewWriter(writer); } }
public bool loadNewReader(EexBinaryReader reader) { header.loadReader(reader); sceneList.Clear(); int sceneNum = (reader.readInt32() - 10) / 4; for (int i = 0; i < sceneNum; i++) { reader.setIndex(10 + i * 4); int pos = reader.readInt32(); reader.setIndex(pos); ScriptScene scene = new ScriptScene(); scene.loadNewReader(reader); sceneList.Add(scene); } return(true); }
public void saveWriter(EexBinaryWriter writer, int group) { cmdIndexList.Clear(); header.saveWriter(writer); writer.setIndex(10 + sceneList.Count * 4); for (int i = 0; i < sceneList.Count; i++) { int wIndex = writer.getIndex(); writer.setIndex(10 + i * 4); writer.writeInt32(wIndex); writer.setIndex(wIndex); cmdIndexList.Add(wIndex); ScriptScene item = sceneList[i]; item.saveWriter(writer, group); foreach (int index in item.cmdIndexList) { cmdIndexList.Add(index); } } if (CorrectCmdData(false)) { writer.setIndex(10 + sceneList.Count * 4); for (int i = 0; i < sceneList.Count; i++) { int wIndex = writer.getIndex(); writer.setIndex(10 + i * 4); writer.writeInt32(wIndex); writer.setIndex(wIndex); ScriptScene item = sceneList[i]; item.saveWriter(writer, group); } } }