59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
namespace LocationsApi.Models;
|
|
|
|
public class UpsertLocationRequest
|
|
{
|
|
public int Q { get; set; }
|
|
public int R { get; set; }
|
|
public string Terrain { get; set; } = "Field";
|
|
public string? Label { get; set; }
|
|
public int Level { get; set; } = 1;
|
|
}
|
|
|
|
public class ClaimLocationRequest
|
|
{
|
|
public int Q { get; set; }
|
|
public int R { get; set; }
|
|
}
|
|
|
|
public class BuildLocationRequest
|
|
{
|
|
public int Q { get; set; }
|
|
public int R { get; set; }
|
|
public string BuildingType { get; set; } = "LogCamp";
|
|
}
|
|
|
|
public class LocationResponse
|
|
{
|
|
public string Id { get; set; } = "";
|
|
public int Q { get; set; }
|
|
public int R { get; set; }
|
|
public string Terrain { get; set; } = "Field";
|
|
public string Kind { get; set; } = "Open";
|
|
public string? OwnerUsername { get; set; }
|
|
public string? Label { get; set; }
|
|
public int Level { get; set; }
|
|
public string? BuildingType { get; set; }
|
|
public DateTime? BuildingBuiltAtUtc { get; set; }
|
|
public DateTime? HomeAssignedAtUtc { get; set; }
|
|
public DateTime UpdatedAtUtc { get; set; }
|
|
public bool IsVisible { get; set; } = true;
|
|
|
|
public static LocationResponse FromLocation(Location location) => new()
|
|
{
|
|
Id = location.Id,
|
|
Q = location.Q,
|
|
R = location.R,
|
|
Terrain = location.Terrain,
|
|
Kind = location.Kind,
|
|
OwnerUsername = location.OwnerUsername,
|
|
Label = location.Label,
|
|
Level = location.Level,
|
|
BuildingType = location.BuildingType,
|
|
BuildingBuiltAtUtc = location.BuildingBuiltAtUtc,
|
|
HomeAssignedAtUtc = location.HomeAssignedAtUtc,
|
|
UpdatedAtUtc = location.UpdatedAtUtc,
|
|
IsVisible = true
|
|
};
|
|
|
|
}
|