Add default values for dive in slot

This commit is contained in:
Slendy 2023-03-08 15:26:21 -06:00
commit 223cc0c883
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization; using System.Linq;
using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Levels;
using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms; using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms;
@ -24,13 +24,10 @@ public class FindBestRoom : IMatchCommand
public List<string> Reservations { get; set; } public List<string> Reservations { get; set; }
public List<List<int>> Slots { get; set; } public List<List<int>> Slots { get; set; }
[JsonIgnore]
public IEnumerable<int> FirstSlot => this.Slots[0];
public RoomSlot RoomSlot public RoomSlot RoomSlot
=> new() => new()
{ {
SlotType = (SlotType)this.Slots[0][0], SlotType = (SlotType)(this.Slots.ElementAtOrDefault(0)?.ElementAtOrDefault(0) ?? (int)SlotType.Pod),
SlotId = this.Slots[0][1], SlotId = this.Slots.ElementAtOrDefault(0)?.ElementAtOrDefault(1) ?? 0,
}; };
} }