/// <summary> /// 返回一个以osu文件格式为标准的字符串 /// </summary> /// <returns></returns> public string ToOsuFormat() { if (DrumRollType == DrumRollTypes.Slider) { var b = new StringBuilder($"{Position.x},{Position.y},{Offset},{2},{_curvetype}"); for (var i = 0; i < curvePoints.Count; i++) { if (curvePoints.Count == 1) { b.Append("|" + curvePoints[i].GetData() + ","); break; } if (i == curvePoints.Count - 1) { b.Append("|" + curvePoints[i].GetData() + ","); } else { b.Append($"|{curvePoints[i].GetData()}"); } } b.Append( $"{RepeatTime},{Length},{1 << (int) StartingHitSound.HitSound}|{1 << (int) DuringHitSound.HitSound}|{1 << (int) EndingHitSound.HitSound},"); b.Append( $"{StartingHitSound.Sound.GetData()}|{DuringHitSound.Sound.GetData()}|{EndingHitSound.Sound.GetData()},"); b.Append($"{HitSample.GetData()}"); return(b.ToString()); } return($"256,192,{Offset},{1 << (int) HitObjectType},{1 << (int) HitSound},{EndTime},{HitSample.GetData()}"); }
/// <summary> /// 获取以osu文件的格式为标准的字符串 /// </summary> /// <returns></returns> public string ToOsuFormat() { return($"{Position.x},{Position.y},{Offset},{1 << (int) HitObjectType},{0},{HitSample.GetData()}"); }
/// <summary> /// 获取以osu文件中的描述为格式的字符串 /// </summary> /// <returns></returns> public string ToOsuFormat() { return($"256,192,{Offset},{1 << (int) HitObjectType},{1 << (int) HitSound},{EndTime},{HitSample.GetData()}"); }