namespace Core.Entities;

public class CompetitiveEvent
{
	public string Name { get; set; }
	public string ShortName { get; set; }
	public EventFormat Format { get; set; }
	public int MinTeamSize { get; set; }
	public int MaxTeamSize { get; set; }

	public string TeamSize =>
		MinTeamSize == MaxTeamSize
			? MinTeamSize.ToString()
			: $"{MinTeamSize.ToString()}-{MaxTeamSize.ToString()}";

	public string SemifinalistActivity { get; set; }

	public bool InterviewOrPresentation
		=> SemifinalistActivity.Contains("Interview") || SemifinalistActivity.Contains("Presentation");

	public bool OnSiteActivity
		=> SemifinalistActivity.Contains("Challenge")
		   || SemifinalistActivity.Contains("Race")
		   || SemifinalistActivity.Contains("Speech")
		   || SemifinalistActivity.Contains("Test")
		   || SemifinalistActivity.Contains("Flight")
		   || SemifinalistActivity.Contains("Debate")
		   || SemifinalistActivity.Contains("Photography")
		   || SemifinalistActivity.Contains("Build")
		   || Name.Contains("Chapter")
		   || Name.Contains("Essay")
		   || SemifinalistActivity.Contains("Fly");

	public string RegionalNotes { get; set; }

	public int MaxTeamCountState { get; set; }
	public bool RegionalEvent { get; set; }

	public bool RegionalPresubmit { get; set; }
	public bool StatePresubmission { get; set; }
	public bool StatePretesting { get; set; }
	public bool StatePreliminaryRound { get; set; }

	public string Documentation { get; set; }

	public string Eligibility { get; set; }
	public string Theme { get; set; }
	public string Description { get; set; }
	public int? LevelOfEffort { get; set; }

	public override string ToString()
	{
		return Name;
	}

	public static readonly CompetitiveEvent GeneralSchedule = new(){Name = "General Schedule"};
	public static readonly CompetitiveEvent VotingDelegates = new(){Name = "Voting Delegates"};


	public string EventAttributes ()
	{
		var st = new List<string>();

		if (Format is EventFormat.Individual)
			st.Add( "Ind.");
		if (RegionalEvent)
			st.Add( "Reg.");

		return string.Join(", ", st);
	}
}