mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-19 11:41:30 +00:00
Revert slot API to old functionality
This commit is contained in:
parent
c6156d85cd
commit
f2dd41dd52
3 changed files with 81 additions and 10 deletions
|
@ -1,40 +1,69 @@
|
|||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||
using LBPUnion.ProjectLighthouse.Database;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||
using LBPUnion.ProjectLighthouse.Types.Misc;
|
||||
using LBPUnion.ProjectLighthouse.Types.Users;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses;
|
||||
|
||||
[JsonObject]
|
||||
public struct ApiSlot
|
||||
{
|
||||
public int SlotId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string IconHash { get; set; }
|
||||
public bool TeamPick { get; set; }
|
||||
public bool IsAdventure { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public GameVersion GameVersion { get; set; }
|
||||
public int CreatorId { get; set; }
|
||||
public bool InitiallyLocked { get; set; }
|
||||
public bool SubLevel { get; set; }
|
||||
public bool Lbp1Only { get; set; }
|
||||
public int Shareable { get; set; }
|
||||
public string AuthorLabels { get; set; }
|
||||
public string[] LevelTags { get; set; }
|
||||
public int MinimumPlayers { get; set; }
|
||||
public int MaximumPlayers { get; set; }
|
||||
public bool MoveRequired { get; set; }
|
||||
public long FirstUploaded { get; set; }
|
||||
public long LastUpdated { get; set; }
|
||||
public bool TeamPick { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public GameVersion GameVersion { get; set; }
|
||||
public int Plays { get; set; }
|
||||
public int PlaysUnique { get; set; }
|
||||
public int PlaysComplete { get; set; }
|
||||
public bool CommentsEnabled { get; set; }
|
||||
public double AverageRating { get; set; }
|
||||
public string LevelType { get; set; }
|
||||
|
||||
public static ApiSlot CreateFromEntity(SlotEntity slot) =>
|
||||
public static ApiSlot CreateFromEntity(SlotEntity slot, DatabaseContext context) =>
|
||||
new()
|
||||
{
|
||||
SlotId = slot.SlotId,
|
||||
Name = slot.Name,
|
||||
Description = slot.Description,
|
||||
IconHash = slot.IconHash,
|
||||
TeamPick = slot.TeamPick,
|
||||
IsAdventure = slot.IsAdventurePlanet,
|
||||
Location = slot.Location,
|
||||
GameVersion = slot.GameVersion,
|
||||
CreatorId = slot.CreatorId,
|
||||
InitiallyLocked = slot.InitiallyLocked,
|
||||
SubLevel = slot.SubLevel,
|
||||
Lbp1Only = slot.Lbp1Only,
|
||||
Shareable = slot.Shareable,
|
||||
AuthorLabels = slot.AuthorLabels,
|
||||
LevelTags = slot.LevelTags(context),
|
||||
MinimumPlayers = slot.MinimumPlayers,
|
||||
MaximumPlayers = slot.MaximumPlayers,
|
||||
MoveRequired = slot.MoveRequired,
|
||||
FirstUploaded = slot.FirstUploaded,
|
||||
LastUpdated = slot.LastUpdated,
|
||||
TeamPick = slot.TeamPick,
|
||||
Location = slot.Location,
|
||||
GameVersion = slot.GameVersion,
|
||||
Plays = slot.Plays,
|
||||
PlaysUnique = slot.PlaysUnique,
|
||||
PlaysComplete = slot.PlaysComplete,
|
||||
CommentsEnabled = slot.CommentsEnabled,
|
||||
AverageRating = slot.RatingLBP1,
|
||||
LevelType = slot.LevelType,
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue