mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
986 B
39 lines
986 B
using ErsatzTV.Core.Domain; |
|
using ErsatzTV.Core.Scheduling.YamlScheduling.Models; |
|
|
|
namespace ErsatzTV.Core.Scheduling.YamlScheduling; |
|
|
|
public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definition, int guideGroup) |
|
{ |
|
private readonly System.Collections.Generic.HashSet<int> _visitedInstructions = []; |
|
private int _instructionIndex; |
|
|
|
public Playout Playout { get; } = playout; |
|
|
|
public YamlPlayoutDefinition Definition { get; } = definition; |
|
|
|
public DateTimeOffset CurrentTime { get; set; } |
|
|
|
public int InstructionIndex |
|
{ |
|
get => _instructionIndex; |
|
set |
|
{ |
|
_instructionIndex = value; |
|
_visitedInstructions.Add(value); |
|
} |
|
} |
|
|
|
public bool VisitedAll => _visitedInstructions.Count >= Definition.Playout.Count; |
|
|
|
public int NextGuideGroup() |
|
{ |
|
guideGroup++; |
|
if (guideGroup > 1000) |
|
{ |
|
guideGroup = 1; |
|
} |
|
|
|
return guideGroup; |
|
} |
|
}
|
|
|