赛事功能完善
创建比赛按钮;loading页面more按钮等
This commit is contained in:
1 parent
eed2d13624
commit
e76b5c443f
55 files changed
+7805
-3376
No files matched your search
@@ -103,7 +103,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
MapUDPService.Send(route.RouteInstance.Id, recorderData.BelongUserId,
|
||||
new double[] { lastData._Lat, lastData._Lon },
|
||||
recorderData.IsCompleted, false, recorderData.EndDistance,
|
||||
true, 1, lastData._Speed, false, preDistance, weightKg, competitionId: recorderData.Competitionid, recorderData.Saved);
|
||||
true, 1, lastData._Speed, false, preDistance, weightKg, competitionId: recorderData.Competitionid, recorderData.Saved, lastData._HeartRate, lastData._Power, lastData._Cadence, lastData.Ticks);
|
||||
}
|
||||
else if (recorderData.EndDistance > 0)//没有骑,但是有初始位置的情况
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CanStart())
|
||||
//if (CanStart())
|
||||
{
|
||||
var second = Math.Ceiling((Now - mapCompetition.StartTime.ToLocalTime()).TotalSeconds);
|
||||
|
||||
@@ -135,7 +135,11 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
WxHeadImg = item.HeadImage,
|
||||
Point = new GeoJSON.Net.Geometry.GeographicPosition(item.Point[0], item.Point[1]),
|
||||
EndDistance = item.EndDistance,
|
||||
PreDistance = item.PreDistance
|
||||
PreDistance = item.PreDistance,
|
||||
Power = item.Power,
|
||||
HeartRate = item.HeartRate,
|
||||
Cadence = item.Cadence,
|
||||
TotalTicks = item.TotalTicks,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -196,18 +200,58 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
CreateTime = createTime,
|
||||
TripTime = ranking?.TripTime ?? "",
|
||||
CompleteTime = ranking?.CompleteTime,
|
||||
Gap = ranking?.Gap ?? ""
|
||||
Gap = ranking?.Gap ?? "",
|
||||
Country = ranking.Country,
|
||||
WxHeadImg = ranking.WxHeadImg
|
||||
});
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 骑行实时排名&比赛结果列表 取前六名
|
||||
|
||||
List<CompetitionTopModel> CompetitionTopList = new List<CompetitionTopModel>();
|
||||
|
||||
var resultList =results.Take(6);
|
||||
var count = 6 - resultList.Count();
|
||||
//先取比赛结果
|
||||
foreach (var item in resultList)
|
||||
{
|
||||
CompetitionTopList.Add(new CompetitionTopModel
|
||||
{
|
||||
Index = item.Index,
|
||||
TripTime = item.TripTime,
|
||||
Country = item.Country,
|
||||
Name = item.Name,
|
||||
UserId = item.UserId
|
||||
});
|
||||
}
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
var ss = sort.Where(c => !resultList.Select(p => p.UserId).Contains(c.UserId)).Take(count);
|
||||
foreach (var item in ss)
|
||||
{
|
||||
CompetitionTopList.Add(new CompetitionTopModel
|
||||
{
|
||||
Index = item.Index,
|
||||
TripTime = "———",
|
||||
Country = item.CountryImg,
|
||||
Name = item.Name,
|
||||
UserId = item.UserId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
competitionRankingModel = new CompetitionRankingModel
|
||||
{
|
||||
Sorts = sort,//骑行实时排名
|
||||
MyRanking = sort.FindIndex(n => n.UserId == currentPlayer.UserId) + 1,//切换人物显示对应人物的排名
|
||||
Total = sort.Count,//总人数
|
||||
Results = results//比赛结果列表
|
||||
Results = results,//比赛结果列表,
|
||||
TopList = CompetitionTopList,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -313,7 +357,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
/// <returns></returns>
|
||||
public (int, bool) EndCountDown()
|
||||
{
|
||||
if (CanStart() == false) return (0, false);
|
||||
//if (CanStart() == false) return (0, false);
|
||||
//if (recorderData.IsCompleted) return 0;
|
||||
var end1 = (int)Math.Floor((mapCompetition.EndTime.ToLocalTime() - Now).TotalSeconds);
|
||||
if (!FirstEndTime.HasValue)
|
||||
|
||||
Reference in new issue
Block a user