Exemple #1
0
 public Tie(DateTime firstLegDate, DateTime secondLegDate, Team team1, Team team2)
 {
     FirstLegDate = firstLegDate;
     SecondLegDate = secondLegDate;
     Team1 = team1;
     Team2 = team2;
 }
        public TeamTournamentStats(TournamentSeason tournamentSeason, Team team)
        {
            TournamentSeason = tournamentSeason;
            Team = team;

            PlayerStats = new List<PlayerTournamentStats>();
        }
        public int CreateTeam(int worldId, string name, TeamStrategy strategy, IEnumerable<Tuple<PositionCode, int>> squad)
        {
            var world = Context.Worlds.Find(worldId);
            var team = new Team(world, name, strategy,
                squad.Select(s => new SquadMember(s.Item1, s.Item2)).ToArray());

            Context.Teams.Add(team);
            Context.SaveChanges();

            return team.Id;
        }
Exemple #4
0
 private Fixture(World world, int tournamentSeasonId, DateTime date, Team team1, Team team2, bool isNeutralGround, bool requiresExtraTime)
 {
     TournamentSeasonId = tournamentSeasonId;
     World = world;
     Date = date;
     Team1 = team1;
     Team2 = team2;
     Team1Name = team1.Name;
     Team2Name = team2.Name;
     IsNeutralGround = isNeutralGround;
     RequiresExtraTime = requiresExtraTime;
 }
        private MatchSimulator.Domain.Team ConvertTeamForMatchSimulator(Team team)
        {
            var matchTeam = new MatchSimulator.Domain.Team(team.Name, team.Strategy);

            foreach (var squadMember in team.Squad)
            {
                Player player = squadMember.Player;
                matchTeam.AddSquadPlayer(player.Id, player.Name,
                    MatchSimulator.Domain.Position.FromCode(squadMember.Position),
                    player.DefensiveSkills, player.OffensiveSkills, player.Form);
            }

            return matchTeam;
        }
 public MatchResult(Fixture fixture, Team winner, int score1, int score2, int penaltyScore1, int penaltyScore2,
     IEnumerable<Goal> goals,
     IEnumerable<PlayerMatchStats> playersStats1,
     IEnumerable<PlayerMatchStats> playersStats2)
 {
     TournamentSeasonId = fixture.TournamentSeasonId;
     Date = fixture.Date;
     Team1 = fixture.Team1;
     Team2 = fixture.Team2;
     Team1Name = fixture.Team1Name;
     Team2Name = fixture.Team2Name;
     Winner = winner;
     Score1 = score1;
     Score2 = score2;
     PenaltyScore1 = penaltyScore1;
     PenaltyScore2 = penaltyScore2;
     Goals = goals.ToList();
     PlayersStats1 = playersStats1.ToList();
     PlayersStats2 = playersStats2.ToList();
 }
Exemple #7
0
 public TeamPair(Team team1, Team team2)
 {
     Team1 = team1;
     Team2 = team2;
 }
 protected void PromoteTeam(Team team)
 {
     PromotedTeams.Add(team);
 }
 public TeamStats GetStatsFor(Team team)
 {
     return TeamStats.First(s => s.Team == team);
 }
 private TournamentSeason DivisionByTeam(Team team)
 {
     return Divisions.First(d => d.Teams.Contains(team));
 }
 public void RelegateTeam(Team team)
 {
     RelegatedTeams.Add(team);
 }
 public void PromoteTeam(Team team)
 {
     PromotedTeams.Add(team);
 }
Exemple #13
0
 public Fixture(TournamentSeason tournamentSeason, DateTime date, Team team1, Team team2, bool isNeutralGround, bool requiresExtraTime)
     : this(tournamentSeason.World, tournamentSeason.Id, date, team1, team2, isNeutralGround, requiresExtraTime)
 {
 }