sessions
This commit is contained in:
29
Assets/Engine/Runtime/Measurements/Session.cs
Normal file
29
Assets/Engine/Runtime/Measurements/Session.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using EscapeRoomEngine.Engine.Runtime.Utilities;
|
||||
using JetBrains.Annotations;
|
||||
using MongoDB.Bson;
|
||||
using Realms;
|
||||
|
||||
namespace EscapeRoomEngine.Engine.Runtime.Measurements
|
||||
{
|
||||
[SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")]
|
||||
public class Session : RealmObject
|
||||
{
|
||||
[PrimaryKey]
|
||||
public ObjectId ID { get; set; }
|
||||
public float Time { get; set; }
|
||||
public IList<Puzzle> PuzzlesSolved { get; }
|
||||
|
||||
[UsedImplicitly]
|
||||
public Session()
|
||||
{
|
||||
ID = ObjectId.GenerateNewId();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Session {ID}: {PuzzlesSolved.Count} puzzles solved in {Time.ToTimeSpan():m':'ss}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user