powerfun-new-net/Model/MapRecordRanking.cs

82 lines
1.8 KiB
C#
Raw Normal View History

2020-09-17 10:23:26 +08:00
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; }
2020-10-27 10:20:47 +08:00
public int Ticks { get; set; } = -1;
2020-09-17 10:23:26 +08:00
public Guid Id { get; set; }
public string[] record { get; set; }
public string WxHeadImg { get; set; }
public string NickName { get; set; }
2020-10-27 10:20:47 +08:00
/// <summary>
/// 体重,用于计算功率体重比
/// </summary>
public double Weight { get; set; }
2020-09-17 10:23:26 +08:00
/// <summary>
/// 总点位数据
/// </summary>
public int Count
{
get
{
return this.record.Length;
}
}
private int _BeginIndex;
/// <summary>
/// 当前位置
/// </summary>
public int CurrentIndex
{
2020-10-27 10:20:47 +08:00
get; set;
} = -1;
2020-09-17 10:23:26 +08:00
/// <summary>
/// 是否已到头
/// </summary>
public bool End
{
get
{
2020-10-27 10:20:47 +08:00
return this.CurrentIndex >= this.Count;
2020-09-17 10:23:26 +08:00
}
}
/// <summary>
/// 获取当前点位的数据
/// </summary>
/// <returns></returns>
public TargetData GetCurrentTargetData()
{
2020-10-27 10:20:47 +08:00
if(CurrentIndex > this.record.Length - 1)
{
return TargetData.Read(this.record[this.record.Length - 1]);
}
2020-09-17 10:23:26 +08:00
return TargetData.Read(this.record[CurrentIndex]);
}
2020-10-27 10:20:47 +08:00
public double GetPreDistance()
{
if (CurrentIndex < 1) return 0;
return TargetData.Read(this.record[CurrentIndex - 1])._Distance;
}
2020-09-17 10:23:26 +08:00
}
}