public void ParseCommandData(IList <String> lines, Byte commandId) { if (CommandTimeList.ContainsKey(commandId)) { return; } IList <Single> eventTimeList = new List <Single>(); IList <String> eventTypeList = new List <String>(); IList <String> eventArgsList = new List <String>(); UInt16 count = (UInt16)(lines.Count); for (UInt16 index = 0; index < count; ++index) { String line = lines[index]; String[] items = line.Split(Constants.Delim0); Single time = Convert.ToSingle(items[0], CultureInfo.InvariantCulture) * ratio; eventTimeList.Add(time); eventTypeList.Add(items[1]); eventArgsList.Add(items[2]); } CommandTimeList.Add(commandId, eventTimeList); CommandTypeList.Add(commandId, eventTypeList); CommandArgsList.Add(commandId, eventArgsList); }
public void LoadCommandData(Byte commandId) { if (CommandTimeList.ContainsKey(commandId)) { return; } String file = String.Format("{0}/{1}.txt", commandRoot, commandId.ToString().PadLeft(2, '0')); var lines = MyGame.Manager.FileManager.LoadTxt(file); ParseCommandData(lines, commandId); }