コード例 #1
0
        public void AddTeamToDivision(SeasonDivision division, SeasonTeam team)
        {
            //first if the division
            if (!team.IsDivisionInList(division))
            {
                team.AddDivisionToTeam(division);
            }

            if (!division.IsTeamInList(team))
            {
                division.AddTeam(team);
            }
        }
コード例 #2
0
        public void AddTeam(SeasonTeam team)
        {
            if (!(Children.ToList().Where(d => d.IsTeamInDivision(team)).ToList().FirstOrDefault() == null))
            {
                throw new SeasonException("Team : " + team.Name + " already belongs to a child division of " + Name);
            }

            if (Parent != null && Parent.IsTeamInDivision(team))
            {
                throw new SeasonException("Team : " + team.Name + " belongs to the parent division - " + Parent.Name + " - " + Name);
            }

            team.AddDivisionToTeam(this);

            _Teams.Add(team);
        }
コード例 #3
0
ファイル: SeasonRanking.cs プロジェクト: jodyunter/TeamGame
 public SeasonRanking(SeasonTeam team, int rank, SeasonDivision division)
 {
     Team     = team;
     Rank     = rank;
     Division = division;
 }
コード例 #4
0
 //this could be child division
 public bool IsTeamInDivision(SeasonTeam team)
 {
     return(Teams.Where(t => t.Parent.Id == team.Parent.Id).FirstOrDefault() != null);
 }