public TableUnit Clone() { var recordUnit = new TableUnit(); recordUnit.Number = Number; recordUnit.PlayCount = PlayCount; recordUnit.LinkNumber = LinkNumber; recordUnit.PlaylogDetail = PlaylogDetail; return(recordUnit); }
TableUnit ParseRow(string row) { var recordUnit = new TableUnit(); var index = 0; recordUnit.Number = GetField(row, ref index, int.Parse); recordUnit.PlayCount = GetField(row, ref index, int.Parse); var playlogDetail = new PlaylogDetail(); playlogDetail.Name = GetTextField(row, ref index); playlogDetail.Difficulty = GetField(row, ref index, value => (Difficulty)Enum.Parse(typeof(Difficulty), value)); playlogDetail.Score = GetField(row, ref index, int.Parse); playlogDetail.JusticeCriticalCount = GetField(row, ref index, int.Parse); playlogDetail.JusticeCount = GetField(row, ref index, int.Parse); playlogDetail.AttackCount = GetField(row, ref index, int.Parse); playlogDetail.MissCount = GetField(row, ref index, int.Parse); playlogDetail.MaxCombo = GetField(row, ref index, int.Parse); playlogDetail.TapPercentage = GetField(row, ref index, double.Parse); playlogDetail.HoldPercentage = GetField(row, ref index, double.Parse); playlogDetail.SlidePercentage = GetField(row, ref index, double.Parse); playlogDetail.AirPercentage = GetField(row, ref index, double.Parse); playlogDetail.FlickPercentage = GetField(row, ref index, double.Parse); playlogDetail.IsClear = GetField(row, ref index, bool.Parse); playlogDetail.IsNewRecord = GetField(row, ref index, bool.Parse); playlogDetail.ComboStatus = GetField(row, ref index, value => (ComboStatus)Enum.Parse(typeof(ComboStatus), value)); playlogDetail.ChainStatus = GetField(row, ref index, value => (ChainStatus)Enum.Parse(typeof(ChainStatus), value)); playlogDetail.PlayDate = DateTime.Parse(GetTextField(row, ref index)); playlogDetail.Track = GetField(row, ref index, int.Parse); playlogDetail.CharacterName = GetTextField(row, ref index); playlogDetail.SkillName = GetTextField(row, ref index); playlogDetail.SkillLevel = GetField(row, ref index, int.Parse); playlogDetail.SkillResult = GetField(row, ref index, int.Parse); playlogDetail.StoreName = GetTextField(row, ref index); recordUnit.LinkNumber = GetField(row, ref index, int.Parse); recordUnit.PlaylogDetail = playlogDetail; return(recordUnit); }
string ToStringRecordUnit(TableUnit recordUnit) { var playlogDetail = recordUnit.PlaylogDetail; var row = new StringBuilder(); Append(row, recordUnit.Number); Append(row, recordUnit.PlayCount); Append(row, playlogDetail.Name); Append(row, playlogDetail.Difficulty); Append(row, playlogDetail.Score); Append(row, playlogDetail.JusticeCriticalCount); Append(row, playlogDetail.JusticeCount); Append(row, playlogDetail.AttackCount); Append(row, playlogDetail.MissCount); Append(row, playlogDetail.MaxCombo); Append(row, playlogDetail.TapPercentage); Append(row, playlogDetail.HoldPercentage); Append(row, playlogDetail.SlidePercentage); Append(row, playlogDetail.AirPercentage); Append(row, playlogDetail.FlickPercentage); Append(row, playlogDetail.IsClear); Append(row, playlogDetail.IsNewRecord); Append(row, playlogDetail.ComboStatus); Append(row, playlogDetail.ChainStatus); Append(row, playlogDetail.PlayDate.ToString()); Append(row, playlogDetail.Track); Append(row, playlogDetail.CharacterName); Append(row, playlogDetail.SkillName); Append(row, playlogDetail.SkillLevel); Append(row, playlogDetail.SkillResult); Append(row, playlogDetail.StoreName); Append(row, recordUnit.LinkNumber, true); return(row.ToString()); }