mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-11 20:29:45 +08:00
添加项目文件。
This commit is contained in:
14
CRSim.Core/Models/Json.cs
Normal file
14
CRSim.Core/Models/Json.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class Json
|
||||
{
|
||||
public List<Station> Stations { get; set; }
|
||||
public List<TrainNumber> TrainNumbers { get; set; }
|
||||
}
|
||||
}
|
||||
29
CRSim.Core/Models/Settings.cs
Normal file
29
CRSim.Core/Models/Settings.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using CRSim.Core.Converters;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class Settings
|
||||
{
|
||||
[JsonConverter(typeof(TimeSpanConverter))]
|
||||
public TimeSpan TimeOffset { get; set; } = TimeSpan.Zero;
|
||||
|
||||
[JsonConverter(typeof(TimeSpanConverter))]
|
||||
public TimeSpan DepartureCheckInAdvanceDuration { get; set; } = TimeSpan.FromMinutes(20);
|
||||
|
||||
[JsonConverter(typeof(TimeSpanConverter))]
|
||||
public TimeSpan PassingCheckInAdvanceDuration { get; set; } = TimeSpan.FromMinutes(10);
|
||||
|
||||
/// <summary>
|
||||
/// 直到发车前多久停止显示
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(TimeSpanConverter))]
|
||||
public TimeSpan StopDisplayUntilDepartureDuration { get; set; } = TimeSpan.FromMinutes(1);
|
||||
|
||||
[JsonConverter(typeof(TimeSpanConverter))]
|
||||
public TimeSpan StopCheckInAdvanceDuration { get; set; } = TimeSpan.FromMinutes(2);
|
||||
|
||||
public int MaxPages { get; set; } = 3;
|
||||
public int SwitchPageSeconds { get; set; } = 20;
|
||||
}
|
||||
}
|
||||
31
CRSim.Core/Models/Station.cs
Normal file
31
CRSim.Core/Models/Station.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class Station
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<WaitingArea> WaitingAreas { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public List<string> TicketChecks
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> ticketChecks = [];
|
||||
ticketChecks.AddRange([.. WaitingAreas.SelectMany(wa => wa.TicketChecks)]);
|
||||
return ticketChecks;
|
||||
}
|
||||
}
|
||||
|
||||
public List<StationStop> StationStops { get; set; } = [];
|
||||
|
||||
public List<string> Platforms { get; set; } = [];
|
||||
}
|
||||
}
|
||||
31
CRSim.Core/Models/StationStop.cs
Normal file
31
CRSim.Core/Models/StationStop.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using CRSim.Core.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class StationStop
|
||||
{
|
||||
public string Number { get; set; }
|
||||
|
||||
[JsonConverter(typeof(TimeOnlyJsonConverter))]
|
||||
public DateTime? ArrivalTime { get; set; }
|
||||
|
||||
[JsonConverter(typeof(TimeOnlyJsonConverter))]
|
||||
public DateTime? DepartureTime { get; set; }
|
||||
|
||||
public List<string> TicketChecks { get; set; }
|
||||
|
||||
public string Origin { get; set; }
|
||||
|
||||
public string Terminal { get; set; }
|
||||
|
||||
public string Platform { get; set; }
|
||||
|
||||
public string? Landmark { get; set; }
|
||||
}
|
||||
}
|
||||
9
CRSim.Core/Models/TrainNumber.cs
Normal file
9
CRSim.Core/Models/TrainNumber.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class TrainNumber
|
||||
{
|
||||
public string Number { get; set; }
|
||||
public List<TrainStop> TimeTable { get; set; } = [];
|
||||
}
|
||||
}
|
||||
21
CRSim.Core/Models/TrainStop.cs
Normal file
21
CRSim.Core/Models/TrainStop.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using CRSim.Core.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class TrainStop
|
||||
{
|
||||
public string Station { get; set; }
|
||||
|
||||
[JsonConverter(typeof(TimeOnlyJsonConverter))]
|
||||
public DateTime? ArrivalTime { get; set; }
|
||||
|
||||
[JsonConverter(typeof(TimeOnlyJsonConverter))]
|
||||
public DateTime? DepartureTime { get; set; }
|
||||
}
|
||||
}
|
||||
14
CRSim.Core/Models/WaitingArea.cs
Normal file
14
CRSim.Core/Models/WaitingArea.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public class WaitingArea
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public List<string> TicketChecks { get; set; } = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user