public static ReplayInfo ReadTitle(string fileName) { string[] strArray1 = File.ReadAllLines(fileName, Encoding.Default); try { int num = 0; do { }while(strArray1[++num] != "ReplayInformation" && num < strArray1.Length - 1); ReplayInfo replayInfo = new ReplayInfo() { Version = strArray1[num + 1], PlayerName = strArray1[num + 2], Date = strArray1[num + 3], Time = strArray1[num + 4], MyPlaneName = strArray1[num + 5], WeaponType = strArray1[num + 6], Rank = (DifficultLevel)Convert.ToInt32(strArray1[num + 7]), StartStage = strArray1[num + 8], LastStage = strArray1[num + 9], SlowRate = strArray1[num + 10] }; for (int index = num + 11; index < strArray1.Length; ++index) { char[] chArray = new char[1] { '\t' }; string[] strArray2 = strArray1[index].Split(chArray); MyPlaneInfo myPlaneInfo = new MyPlaneInfo() { Life = Convert.ToInt32(strArray2[0]), Spell = Convert.ToInt32(strArray2[1]), Power = Convert.ToInt32(strArray2[2]), Score = Convert.ToInt64(strArray2[3]), Graze = Convert.ToInt32(strArray2[4]), PosX = (float)Convert.ToDouble(strArray2[5]), PosY = (float)Convert.ToDouble(strArray2[6]), LifeChip = Convert.ToInt32(strArray2[7]), SpellChip = Convert.ToInt32(strArray2[8]), LifeUpCount = Convert.ToInt32(strArray2[9]), StarPoint = Convert.ToInt32(strArray2[10]), HighItemScore = Convert.ToInt32(strArray2[11]), Rate = (float)Convert.ToDouble(strArray2[12]), LastColor = (EnchantmentType)Convert.ToInt32(strArray2[13]), DataPosition = Convert.ToInt64(strArray2[14]) }; replayInfo.MyPlaneData.Add(myPlaneInfo); } return(replayInfo); } catch { return(new ReplayInfo()); } }
public void SetReplayStageInfo() { if (this.OnReplay || this.RepInfo.MyPlaneData.Count > 0 && this.RepInfo.MyPlaneData[this.RepInfo.MyPlaneData.Count - 1].DataPosition + 2L == this.Rep.DataPosition) { return; } this.RepInfo.LastStage = this.CurrentStageName; this.RepInfo.SlowRate = this.SlowRate; List <MyPlaneInfo> planeData = this.RepInfo.MyPlaneData; MyPlaneInfo myPlaneInfo1 = new MyPlaneInfo(); myPlaneInfo1.Score = this.MyPlane.Score; myPlaneInfo1.Life = this.MyPlane.Life; myPlaneInfo1.Spell = this.MyPlane.Spell; myPlaneInfo1.Power = this.MyPlane.Power; myPlaneInfo1.Graze = this.MyPlane.Graze; MyPlaneInfo myPlaneInfo2 = myPlaneInfo1; PointF originalPosition = this.MyPlane.OriginalPosition; double x = (double)originalPosition.X; myPlaneInfo2.PosX = (float)x; MyPlaneInfo myPlaneInfo3 = myPlaneInfo1; originalPosition = this.MyPlane.OriginalPosition; double y = (double)originalPosition.Y; myPlaneInfo3.PosY = (float)y; myPlaneInfo1.LifeChip = this.MyPlane.LifeChip; myPlaneInfo1.SpellChip = this.MyPlane.SpellChip; myPlaneInfo1.LifeUpCount = this.MyPlane.LifeUpCount; myPlaneInfo1.StarPoint = this.MyPlane.StarPoint; myPlaneInfo1.HighItemScore = this.MyPlane.HighItemScore; myPlaneInfo1.Rate = this.MyPlane.Rate; myPlaneInfo1.LastColor = this.MyPlane.LastColor; myPlaneInfo1.DataPosition = this.Rep.DataPosition; MyPlaneInfo myPlaneInfo4 = myPlaneInfo1; planeData.Add(myPlaneInfo4); this.Rep.WriteKey(57358); }