using System; using System.Collections.Generic; using System.Text; namespace OnlineUserPool.Model { public class MapRecordRanking { public int UserId { get; set; } public string RecordFileName { get; set; } public int RouteId { get; set; } public int Ticks { get; set; } = -1; public Guid Id { get; set; } public string[] record { get; set; } public string WxHeadImg { get; set; } public string NickName { get; set; } /// /// 体重,用于计算功率体重比 /// public double Weight { get; set; } /// /// 总点位数据 /// public int Count { get { return this.record.Length; } } private int _BeginIndex; /// /// 当前位置 /// public int CurrentIndex { get; set; //get //{ //if (_BeginIndex != 0) //{ // _BeginIndex++; // if (End) // { // return this.Count - 1; // } // return this._BeginIndex; //} //else //{ // _BeginIndex = 1; // return _BeginIndex; // Random random = new Random(); // _BeginIndex = random.Next(0, this.Count); // return _BeginIndex; //} //} } = -1; /// /// 是否已到头 /// public bool End { get { //return this._BeginIndex >= this.Count; return this.CurrentIndex >= this.Count; } } /// /// 获取当前点位的数据 /// /// public TargetData GetCurrentTargetData() { if(CurrentIndex > this.record.Length - 1) { return TargetData.Read(this.record[this.record.Length - 1]); } return TargetData.Read(this.record[CurrentIndex]); } public double GetPreDistance() { if (CurrentIndex < 1) return 0; return TargetData.Read(this.record[CurrentIndex - 1])._Distance; } } }