65 lines
2.0 KiB
C#
Raw Normal View History

using GeoJSON.Net.Geometry;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scenes.Ride.Scripts.Model.RiderModels
{
public class OnlineRiderModel : BaseRider
{
public override RiderType riderType => RiderType.Online;
public double PreDistance { get; set; } = 0;
2022-03-24 09:36:59 +08:00
public double Speed { get; set; } = 0;
public double WeightKg { get; set; } = 0;
/// <summary>
///
/// </summary>
public GeographicPosition Point { get; set; }
public int? FrameRate { get; set; } = 0;
public OutUser GetOutUser(double preDistance, double currentDistance, TurfHelper turfHelper, CyclingStateEnum cyclingState)
{
if (this.IsSelf)
{
var newRealUser = new OutUser()
{
NickName = this.NickName,
WxHeadImg = this.WxHeadImg,
UserId = this.UserId,
//targetData = targetData,
InMapId = this.InMapId,
PreDistance = preDistance,
NextDistance = currentDistance,
Point = turfHelper.Along(currentDistance),
};
if (cyclingState != CyclingStateEnum.Cycling)
{
newRealUser.NextDistance = preDistance;
}
return newRealUser;
}
else
{
var newRealUser = new OutUser()
{
NickName = this.NickName,
WxHeadImg = this.WxHeadImg,
UserId = this.UserId,
//targetData = targetData,
InMapId = this.InMapId,
PreDistance = this.PreDistance,
NextDistance = this.EndDistance,
Point = this.Point, //turfHelper.Along(this.EndDistance)
};
return newRealUser;
}
}
}
}