コード例 #1
0
ファイル: TeamResourceFactory.cs プロジェクト: bouwe77/fmg
        public static TeamResource Create(Team team, TeamLinks teamLinks, bool fullResource)
        {
            var teamResource = new TeamResource(team.Id)
             {
            Name = team.Name,
             };

             if (team.CurrentLeagueCompetition != null)
             {
            var leagueResource = new LeagueResource(team.CurrentLeagueCompetitionId)
            {
               Name = team.CurrentLeagueCompetition.Name,
            };

            teamResource.League = leagueResource;
            teamResource.LeaguePosition = team.CurrentLeaguePosition;
             }

             if (fullResource)
             {
            var ratingResource = RatingFactory.Create(team.Rating);
            teamResource.Rating = ratingResource;

            var formationResource = FormationResourceFactory.Create(team.Formation);
            teamResource.Formation = formationResource;
             }

             return teamResource;
        }
コード例 #2
0
ファイル: GameResource.cs プロジェクト: bouwe77/fmg
 public GameResource(SeasonResource thisSeason, TeamResource myTeam, GameLinks links)
     : base(links)
 {
     MyTeam = myTeam;
      ThisSeason = thisSeason;
 }