ProjectLighthouse/ProjectLighthouse.Servers.API/Responses/MinimalSlot.cs
Dagg dfd1d9b748
LittleBigPlanet 3 Adventure Support (#477)
* Baseline LBP3 Adventure slot support
VERY unsafe and hacky to use as of now, this is just testing the waters.

* ADC file type checking

* Refactor & trimming
This might need to be adjusted if any feature is found to be missing

* isAdventure added to API

* Prototype Adventure icons for Website
I am not an artist, please make this more in line with the originals.

* Override border radius for LBP3 Adventures

* Cleaning

* Remove WriteLine and unused property

* Remove unused libraries

* Handle tracking and submitting of Adventure scores

* Check for null instead of 0
Non-adventure slots will report null, not 0

* Score for adventure slot instead of main slot

* Tweaks for PR

* Identify levels for photos by level resource
Verify this doesn't break anything.

* SlotCardPartial merge with main changes

* PR resolution 2

* probably not what was wanted
Use variables for style extension

* Internal slots already properly identified

* Return line breaks to end of Slot.cs

* Remove line break added by Github

thanks

* Github.

* Make this a one-liner

* Reduce to two lines

* This can also be one line

* This can *also* be one line

* Update ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml

Co-authored-by: Josh <josh@slendy.pw>

* PR changes

* Update ProjectLighthouse/Migrations/20220916141401_ScoreboardAdvSlot.cs

Co-authored-by: Josh <josh@slendy.pw>

Co-authored-by: Josh <josh@slendy.pw>
2022-09-20 16:08:02 -05:00

32 lines
No EOL
942 B
C#

using LBPUnion.ProjectLighthouse.Levels;
using LBPUnion.ProjectLighthouse.PlayerData;
using LBPUnion.ProjectLighthouse.Types;
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses;
public struct MinimalSlot
{
public int SlotId { get; set; }
public string Name { get; set; }
public string IconHash { get; set; }
public bool TeamPick { get; set; }
public bool IsAdventure { get; set; }
public GameVersion GameVersion { get; set; }
#if DEBUG
public long FirstUploaded { get; set; }
#endif
public static MinimalSlot FromSlot(Slot slot)
=> new()
{
SlotId = slot.SlotId,
Name = slot.Name,
IconHash = slot.IconHash,
TeamPick = slot.TeamPick,
IsAdventure = slot.IsAdventurePlanet,
GameVersion = slot.GameVersion,
#if DEBUG
FirstUploaded = slot.FirstUploaded,
#endif
};
}