From 1e27081f520ceeb7518f54e2da1542012074837d Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sun, 9 Jan 2022 15:36:52 +0000 Subject: [PATCH] Updated Models --- Controllers/UserController.cs | 2 +- Models/Route/IWaypoint.cs | 1 + Models/Route/NavaidModel.cs | 5 +++++ Models/Route/WaypointModel.cs | 18 ++++-------------- Models/UserModel.cs | 3 ++- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Controllers/UserController.cs b/Controllers/UserController.cs index 07d893c..c79bd27 100644 --- a/Controllers/UserController.cs +++ b/Controllers/UserController.cs @@ -64,7 +64,7 @@ namespace EFB.Controllers { UserModel user = new UserModel{ EMail = email, - Token = new TokenModel{ + UserToken = new TokenModel{ TokenValue = login.access_token, Expiration = DateTime.UtcNow.AddSeconds(login.expires_in) } diff --git a/Models/Route/IWaypoint.cs b/Models/Route/IWaypoint.cs index 793fa93..1c6944f 100644 --- a/Models/Route/IWaypoint.cs +++ b/Models/Route/IWaypoint.cs @@ -15,5 +15,6 @@ namespace EFB.Models.Route public IWaypoint Next { get; set; } public IWaypoint Previous { get; set; } public bool Visited { get; set; } + } } \ No newline at end of file diff --git a/Models/Route/NavaidModel.cs b/Models/Route/NavaidModel.cs index b353b9e..95686c3 100644 --- a/Models/Route/NavaidModel.cs +++ b/Models/Route/NavaidModel.cs @@ -17,5 +17,10 @@ namespace EFB.Models.Route public IWaypoint Previous { get; set; } = null; public bool Visited { get; set; } = false; + public NavaidModel(string name, string airway, int frequency){ + Name = name; + Airway = Airway; + Frequency = frequency; + } } } \ No newline at end of file diff --git a/Models/Route/WaypointModel.cs b/Models/Route/WaypointModel.cs index ab2e239..abf9c1a 100644 --- a/Models/Route/WaypointModel.cs +++ b/Models/Route/WaypointModel.cs @@ -16,20 +16,10 @@ namespace EFB.Models.Route public IWaypoint Previous { get; set; } = null; public bool Visited { get; set; } - - - - - - - - - - - - - - + public WaypointModel(string name, string airway){ + Name = name; + Airway = Airway; + } } } \ No newline at end of file diff --git a/Models/UserModel.cs b/Models/UserModel.cs index 500b82e..f8179dd 100644 --- a/Models/UserModel.cs +++ b/Models/UserModel.cs @@ -18,10 +18,11 @@ namespace EFB.Models */ public object Id { get; init; } public string EMail { get; init; } - public TokenModel Token { get; set; } = null; + public TokenModel UserToken { get; set; } = null; //Contains the most recent route generated by the user through the App public RouteModel Route { get; set; } = null; + public TokenModel RouteToken { get; set; } = null; //Contains the most recently stored position of the user in the simulator public object SimPosition { get; set; } = null;