mirror of
https://github.com/denglihong2007/CRSim
synced 2026-06-18 07:25:40 +08:00
51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using CRSim.Core.Converters;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace CRSim.Core.Models
|
|
{
|
|
public class TrainStop
|
|
{
|
|
public string? Number { get; set; }
|
|
|
|
public string? Station { get; set; }
|
|
|
|
[JsonConverter(typeof(TimeSpanJsonConverter))]
|
|
public TimeSpan? ArrivalTime { get; set; }
|
|
|
|
[JsonConverter(typeof(TimeSpanJsonConverter))]
|
|
public TimeSpan? DepartureTime { get; set; }
|
|
|
|
[JsonConverter(typeof(TimeSpanJsonConverter))]
|
|
public TimeSpan? Status { get; set; } = TimeSpan.Zero;
|
|
|
|
public List<Guid>? TicketCheckIds { get; set; }
|
|
|
|
public string? Origin { get; set; }
|
|
|
|
public string? Terminal { get; set; }
|
|
|
|
public string? Platform { get; set; }
|
|
|
|
public string? Landmark { get; set; }
|
|
|
|
public int Length { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public StationType StationType
|
|
{
|
|
get
|
|
{
|
|
if (ArrivalTime == null)
|
|
{
|
|
return StationType.Departure;
|
|
}
|
|
else if (DepartureTime == null)
|
|
{
|
|
return StationType.Arrival;
|
|
}
|
|
return StationType.Both;
|
|
}
|
|
}
|
|
}
|
|
}
|