void ReadFile() { try { StreamReader sr = new StreamReader(m_FilePath, Encoding.Default); String line; sr.ReadLine(); sr.ReadLine(); sr.ReadLine(); while ((line = sr.ReadLine()) != null) { string[] str = line.Split('\t'); var id = System.Int32.Parse(str[0]); if (!m_play.ContainsKey(id)) { m_play[id] = new List <SceneplayInfo>(); } var si = new SceneplayInfo(id, m_play[id].Count); si.Pos = System.Int32.Parse(str[1]); var match = Regex.Match(str[2], @"[a-z]+_([0-9]+)"); if (match.Groups.Count > 1) { var index = System.Int32.Parse(match.Groups[1].ToString()); si.ActorID = index; } else { si.ActorID = 0; } var type = str[3]; si.ActType = type; si.SetActInfo(str[4]); si.IconPath = str[5]; si.Audio = System.Int32.Parse(str[6]); si.SetSwitch(0, System.Int32.Parse(str[7]) == 1); si.SetSwitch(1, System.Int32.Parse(str[8]) == 1); si.SetSwitch(2, System.Int32.Parse(str[9]) == 1); si.SetSwitch(3, System.Int32.Parse(str[10]) == 1); si.SetSwitch(4, System.Int32.Parse(str[11]) == 1); si.Describe = str[12]; m_play[id].Add(si); } sr.Close(); } catch (IOException ex) { MessageBox.Show("Msg:" + ex.Message, "文件被占用了。(─.─|||"); } }
public void CreateNewAction(int screenplay_id) { if (!m_play.ContainsKey(screenplay_id)) { m_play[screenplay_id] = new List <SceneplayInfo>(); } var act = new SceneplayInfo(screenplay_id, m_play[screenplay_id].Count); m_play[screenplay_id].Add(act); if (m_UpdateScreenplay.ContainsKey(screenplay_id)) { m_UpdateScreenplay[screenplay_id](screenplay_id); } }