comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -8,16 +8,33 @@ using Realms;
namespace EscapeRoomEngine.Engine.Runtime.Measurements
{
/// <summary>
/// The representation of a session in the database. This stores all plan results during this session and what puzzles were solved.
/// </summary>
[SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")]
public class Session : RealmObject
{
[PrimaryKey]
public ObjectId ID { get; set; }
public float Time { get; set; }
/// <summary>
/// The plan results for each section during this section.
/// </summary>
/// <remarks>The order of the plan results corresponds with the order of the solved puzzles.</remarks>
public IList<PlanResult> PlanResults { get; }
/// <summary>
/// The puzzles solved during this session.
/// </summary>
/// <remarks>The order of the solved puzzles corresponds with the order of the plan results.</remarks>
public IList<Puzzle> PuzzlesSolved { get; }
/// <summary>
/// The section percentiles the current player has been placed in.
/// </summary>
public IEnumerable<float> Percentiles => PlanResults.Select(result => result.SectionPercentile);
/// <summary>
/// The average of all section percentiles.
/// </summary>
public float MeanPercentile => PlanResults.Count == 0 ? .5f : Probability.Mean(Percentiles.ToArray());
[UsedImplicitly]