Exemplo n.º 1
0
        public void SetupQuickPlayGame(object sender, EventArgs args)
        {
            //TODO: replace with proper league settings
            ILeagueService leagueService = new LeagueService();
            var            league        = leagueService.GetGenericLeague();

            Navigation.PushModalAsync(new NavigationPage(new Game.SetupGamePage(league.LeagueId)));
        }
Exemplo n.º 2
0
        public void FillTeam(Guid?teamId)
        {
            if (teamId.HasValue)
            {
                Team = new Models.Team(Service.GetTeam(teamId.Value));
            }
            else
            {
                //TODO: build in option to choose which league the team belongs to
                ILeagueService league = new LeagueService();

                Guid leagueId;
                var  genericLeague = league.GetGenericLeague();
                if (genericLeague != null)
                {
                    leagueId = genericLeague.LeagueId;
                }

                Team = new Models.Team(leagueId);
            }
        }
Exemplo n.º 3
0
        public void FillTeams()
        {
            Teams = new List <Models.Team>();
            TeamPickerDefaultSelectedIndex = -1;

            //determine players team id available
            if (PlayerId.HasValue)
            {
                var team = PlayerTeam.GetPlayerTeams(PlayerId.Value).FirstOrDefault();
                if (team != null)
                {
                    TeamId = team.TeamId;
                }
            }

            if (!LeagueId.HasValue)
            {
                ILeagueService leagueService = new LeagueService();
                var            league        = leagueService.GetGenericLeague();
                if (league != null)
                {
                    LeagueId = league.LeagueId;
                }
            }
            if (LeagueId.HasValue)
            {
                ITeamService teamService = new TeamService();

                int index = 0;
                foreach (var team in teamService.GetTeams(LeagueId.Value))
                {
                    Teams.Add(new Models.Team(team));
                    if (team.TeamId == TeamId)
                    {
                        TeamPickerDefaultSelectedIndex = index;
                    }
                    index++;
                }
            }
        }