I have website to perform match action. I am writing code to restrict some of the action based on current match stage. For example, If first half is current stage then I should restrict direct end match without second half. For each stage, I have multiple restrict stages. Below is my stage enum.
public enum MatchStage
{
FirstHalfAssumedStartTime = 1,
FirstHalfAssumedEndTime = 2,
SecondHalfAssumedStartTime = 3,
SecondHalfAssumedEndTime = 4,
ExtraFirstHalfAssumedStartTime = 5,
ExtraFirstHalfAssumedEndTime = 6,
ExtraSecondHalfAssumedStartTime = 7,
ExtraSecondHalfAssumedEndTime = 8,
PauseStartTime = 9,
PauseEndTime = 10,
EndMatchTime = 11
}
I would like to make below method work. I want to call something like currentSiteCoreStage.RestrictedStages which returns List of restricted stages. How can I achieve this?
public static bool IsProposedStageValid(MatchStage currentSiteCoreStage, MatchStage proposedStage )
{
if (currentSiteCoreStage.RestrictedStages.Contains(proposedStage)) // I am hoping to make this work
return false;
}