Adding units
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
namespace LocationsApi.Models;
|
||||
|
||||
public class TrainUnitRequest
|
||||
{
|
||||
public string UnitType { get; set; } = "Scout";
|
||||
}
|
||||
|
||||
public class UnitTrainingResponse
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string Username { get; set; } = "";
|
||||
public string UnitType { get; set; } = "";
|
||||
public int GoldCost { get; set; }
|
||||
public string Status { get; set; } = "";
|
||||
public DateTime StartedAtUtc { get; set; }
|
||||
public DateTime CompletesAtUtc { get; set; }
|
||||
public DateTime? CompletedAtUtc { get; set; }
|
||||
|
||||
public static UnitTrainingResponse FromTraining(UnitTraining training) => new()
|
||||
{
|
||||
Id = training.Id,
|
||||
Username = training.Username,
|
||||
UnitType = training.UnitType,
|
||||
GoldCost = training.GoldCost,
|
||||
Status = training.Status,
|
||||
StartedAtUtc = training.StartedAtUtc,
|
||||
CompletesAtUtc = training.CompletesAtUtc,
|
||||
CompletedAtUtc = training.CompletedAtUtc
|
||||
};
|
||||
}
|
||||
|
||||
public class PlayerUnitsResponse
|
||||
{
|
||||
public int CompletedScouts { get; set; }
|
||||
public List<UnitTrainingResponse> Training { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user