예제 #1
0
        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;
 }