first commit
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
namespace Fragalytics.Web.Models;
|
||||
|
||||
public sealed class AppState
|
||||
{
|
||||
public int NextDemoId { get; set; } = 1;
|
||||
public int NextMatchId { get; set; } = 1;
|
||||
public int NextPlayerId { get; set; } = 1;
|
||||
public int NextRoundId { get; set; } = 1;
|
||||
public int NextEventId { get; set; } = 1;
|
||||
public int NextHighlightId { get; set; } = 1;
|
||||
public int NextClipJobId { get; set; } = 1;
|
||||
public int NextClipAssetId { get; set; } = 1;
|
||||
public int NextScoringProfileId { get; set; } = 1;
|
||||
|
||||
public List<DemoRecord> Demos { get; set; } = [];
|
||||
public List<MatchRecord> Matches { get; set; } = [];
|
||||
public List<PlayerRecord> Players { get; set; } = [];
|
||||
public List<RoundRecord> Rounds { get; set; } = [];
|
||||
public List<EventRecord> Events { get; set; } = [];
|
||||
public List<HighlightRecord> Highlights { get; set; } = [];
|
||||
public List<ClipJobRecord> ClipJobs { get; set; } = [];
|
||||
public List<ClipAssetRecord> ClipAssets { get; set; } = [];
|
||||
public List<ScoringProfileRecord> ScoringProfiles { get; set; } = [];
|
||||
}
|
||||
|
||||
public sealed class DemoRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string OriginalFileName { get; set; } = string.Empty;
|
||||
public string StoredPath { get; set; } = string.Empty;
|
||||
public string ParserBackend { get; set; } = string.Empty;
|
||||
public string Status { get; set; } = "uploaded";
|
||||
public string? ErrorMessage { get; set; }
|
||||
public DateTime UploadedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ProcessedAtUtc { get; set; }
|
||||
public int? MatchId { get; set; }
|
||||
}
|
||||
|
||||
public sealed class MatchRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int DemoId { get; set; }
|
||||
public string? MapName { get; set; }
|
||||
public string? ServerName { get; set; }
|
||||
public int? TickRate { get; set; }
|
||||
public int TotalRounds { get; set; }
|
||||
public string? TeamCtName { get; set; }
|
||||
public string? TeamTName { get; set; }
|
||||
public DateTime ParsedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public sealed class PlayerRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MatchId { get; set; }
|
||||
public string SteamId { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? TeamName { get; set; }
|
||||
public string? Side { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RoundRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MatchId { get; set; }
|
||||
public int Number { get; set; }
|
||||
public int? StartTick { get; set; }
|
||||
public int? EndTick { get; set; }
|
||||
public string? WinnerSide { get; set; }
|
||||
public string? WinnerTeamName { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
}
|
||||
|
||||
public sealed class EventRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MatchId { get; set; }
|
||||
public int? RoundId { get; set; }
|
||||
public string EventType { get; set; } = "kill";
|
||||
public int Tick { get; set; }
|
||||
public double? Second { get; set; }
|
||||
public int? ActorPlayerId { get; set; }
|
||||
public int? TargetPlayerId { get; set; }
|
||||
public string? Weapon { get; set; }
|
||||
public bool IsHeadshot { get; set; }
|
||||
public bool IsWallbang { get; set; }
|
||||
public bool IsSmokeKill { get; set; }
|
||||
public int? KillerAliveCount { get; set; }
|
||||
public int? EnemyAliveCount { get; set; }
|
||||
public string? KillerNameSnapshot { get; set; }
|
||||
public string? VictimNameSnapshot { get; set; }
|
||||
}
|
||||
|
||||
public sealed class HighlightRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MatchId { get; set; }
|
||||
public int? RoundId { get; set; }
|
||||
public int SourceEventId { get; set; }
|
||||
public double Score { get; set; }
|
||||
public List<string> Tags { get; set; } = [];
|
||||
public List<ScoreExplanationRecord> Explanation { get; set; } = [];
|
||||
public string ScoringVersion { get; set; } = string.Empty;
|
||||
public int StartTick { get; set; }
|
||||
public int EndTick { get; set; }
|
||||
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public sealed class ScoreExplanationRecord
|
||||
{
|
||||
public string Reason { get; set; } = string.Empty;
|
||||
public double Value { get; set; }
|
||||
public string Detail { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class ClipJobRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int HighlightId { get; set; }
|
||||
public string Renderer { get; set; } = "future-renderer";
|
||||
public string Status { get; set; } = "pending";
|
||||
public int StartTick { get; set; }
|
||||
public int EndTick { get; set; }
|
||||
public Dictionary<string, string> Payload { get; set; } = [];
|
||||
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
public int? ClipAssetId { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
public DateTime? StartedAtUtc { get; set; }
|
||||
public DateTime? CompletedAtUtc { get; set; }
|
||||
}
|
||||
|
||||
public sealed class ClipAssetRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ClipJobId { get; set; }
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public string StoredPath { get; set; } = string.Empty;
|
||||
public string ContentType { get; set; } = "video/mp4";
|
||||
public long FileSizeBytes { get; set; }
|
||||
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public sealed class ScoringProfileRecord
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = "default";
|
||||
public string Version { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
|
||||
public HighlightScoringRules Rules { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class HighlightScoringRules
|
||||
{
|
||||
public string Name { get; set; } = "default";
|
||||
public Dictionary<string, double> Weights { get; set; } = new();
|
||||
public ClipWindowRules Clip { get; set; } = new();
|
||||
public ScoreThresholdRules Thresholds { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class ClipWindowRules
|
||||
{
|
||||
public int PreTicks { get; set; } = 160;
|
||||
public int PostTicks { get; set; } = 96;
|
||||
}
|
||||
|
||||
public sealed class ScoreThresholdRules
|
||||
{
|
||||
public double HighlightScoreMin { get; set; } = 18;
|
||||
}
|
||||
Reference in New Issue
Block a user