void nullping(team t, ObjectiveScript o)
 {
 }
Exemple #2
0
    private void Winner(team t)
    {
        string gamelog = RedName + "vs" + BlueName + ".txt";

        if (t == team.red)
        {
            currentGameState = GameState.Finished;
            Notify.text      = "RED TEAM WON!!";
            Notify.color     = Color.red;
            Notify.enabled   = true;
            if (System.IO.File.Exists(gamelog))
            {
                System.IO.File.Delete(gamelog);
            }
            using (StreamWriter writetext = File.AppendText(gamelog))
            {
                writetext.Write("RED");
                //writetext.WriteLine();
                writetext.Close();
            }
            Invoke("quit", 5.0f);
            //Application.Quit();
        }
        else if (t == team.blue)
        {
            currentGameState = GameState.Finished;
            Notify.text      = "BLUE TEAM WON!!";
            Notify.color     = Color.blue;
            Notify.enabled   = true;
            if (System.IO.File.Exists(gamelog))
            {
                System.IO.File.Delete(gamelog);
            }
            using (StreamWriter writetext = File.AppendText(gamelog))
            {
                writetext.Write("BLUE");
                //writetext.WriteLine();
                writetext.Close();
            }
            Invoke("quit", 5.0f);
            //Application.Quit();
        }
        else if (t == team.none)
        {
            currentGameState = GameState.Finished;
            Notify.text      = "TIE!!";
            Notify.color     = Color.green;
            Notify.enabled   = true;
            if (System.IO.File.Exists(gamelog))
            {
                System.IO.File.Delete(gamelog);
            }
            using (StreamWriter writetext = File.AppendText(gamelog))
            {
                writetext.WriteLine("TIE");
                //writetext.WriteLine();
                writetext.Close();
            }
            Invoke("quit", 5.0f);
            //Application.Quit();
        }
    }
Exemple #3
0
        public void GroupTest()
        {
            var teamType1En = new team
            {
                abbreviation     = "ABC",
                country          = "Germany",
                id               = "sr:team:1",
                name             = "Team A",
                @virtual         = true,
                virtualSpecified = true
            };
            var teamType1De = new team
            {
                abbreviation     = "ABC",
                country          = "Deutschland",
                id               = "sr:team:1",
                name             = "Team A",
                @virtual         = true,
                virtualSpecified = true
            };
            var teamType2En = new team
            {
                abbreviation     = "ABC",
                country          = "Germany",
                id               = "sr:team:2",
                name             = "Team B",
                @virtual         = true,
                virtualSpecified = true
            };
            var teamType2De = new team
            {
                abbreviation     = "ABC",
                country          = "Deutschland",
                id               = "sr:team:2",
                name             = "Team B",
                @virtual         = true,
                virtualSpecified = true
            };
            var groupType1 = new tournamentGroup
            {
                name       = "Group A",
                competitor = new[] { teamType1En, teamType2En }
            };
            var groupType2 = new tournamentGroup
            {
                name       = "Group A",
                competitor = new[] { teamType1De, teamType2De }
            };
            var groupDTO1 = new GroupDTO(groupType1);
            var groupDTO2 = new GroupDTO(groupType2);

            var groupCI = new GroupCI(groupDTO1, _cultureFirst);

            groupCI.Merge(groupDTO2, _cultureSecond);

            Assert.IsNotNull(groupCI);
            Assert.AreEqual(groupType1.name, groupCI.Name);
            Assert.AreEqual(groupType1.competitor.Length, groupCI.CompetitorsIds.Count());
            Assert.AreEqual(groupType1.competitor[0].id, groupCI.CompetitorsIds.ToList()[0].ToString());
            Assert.AreEqual(groupType1.competitor[1].id, groupCI.CompetitorsIds.ToList()[1].ToString());
            Assert.AreNotEqual(groupCI.CompetitorsIds.ToList()[0].Id, groupCI.CompetitorsIds.ToList()[1]);
        }
 private void nullPing3(actions s, team t, int o, int i)
 {
     //Do nothing
 }
        public IHttpActionResult GetResultTable(int leagueId)
        {
            long seasonId = GetCurrentSeasonId(leagueId, DateTime.Now);

            if (seasonId == 0)
            {
                return(Ok());
            }

            scoretableview[]           _scoreTable = null;
            season                     _season     = null;
            List <ScoreTableResultDTO> scoreTable  = new List <ScoreTableResultDTO>();

            using (var context = new escorcenterdbEntities())
            {
                _scoreTable = (from st in context.scoretableviews where st.season == seasonId select st).OrderBy(st => st.GamesWon.Value * 3 + st.GamesDrawn.Value * 1).ToArray <scoretableview>();
                _season     = (from s in context.seasons where s.id == seasonId && s.enabled == true select s).FirstOrDefault <season>();

                if (_scoreTable == null || _season == null)
                {
                    return(NotFound());
                }

                foreach (scoretableview st in _scoreTable)
                {
                    team _team = (from t in context.teams where t.Id == st.team select t).FirstOrDefault <team>();

                    String leagueName          = getLeagueNameById(_team.League);
                    ScoreTableResultDTO result = new ScoreTableResultDTO
                    {
                        Team        = AutoMapper.Mapper.Map <team, TeamDTO>(_team),
                        GamesDrawn  = st.GamesDrawn.Value,
                        GamesLost   = st.GamesLost.Value,
                        GamesPlayed = st.GamesPlayed.Value,
                        GamesWined  = st.GamesWon.Value,
                        //Cambiar esto a hacerlo dinamico, no solo para el fut
                        Points          = st.GamesWon.Value * 3 + st.GamesDrawn.Value * 1,
                        ScoreAgainst    = (long)st.ScoreAgainst.Value,
                        ScoreDifference = (long)st.ScoreDifference.Value,
                        ScoreFavor      = (long)st.ScoreFavor.Value,
                        League          = leagueName
                    };

                    scoreTable.Add(result);
                }
            }
            if (_season == null)
            {
                return(Ok());
            }

            scoreTable.OrderBy(r => r.Points);

            SeasonDTO season = new SeasonDTO
            {
                DateFrom    = _season.dateFrom.ToString(),
                DateTo      = _season.dateTo.ToString(),
                Description = _season.description,
                Id          = _season.id,
                League      = _season.league,
                Title       = _season.title
            };

            season.ScoreTableResult.AddRange(scoreTable);
            return(Ok(season));
        }
Exemple #6
0
    //public CharacterGraphics cg;

    void SelectTeam(team _newTeam)
    {
        teamTag = _newTeam;
        transform.gameObject.tag = teamTag.ToString();
    }
Exemple #7
0
        public bool isMyTurn(int turn)
        {
            team teamNumberTurn = (team)(turn % 2 + 1);

            return(TeamNumber == teamNumberTurn);
        }
 public void insertTeam(team team)
 {
     context.team.Add(team);
     context.SaveChanges();
 }
 public void combatRefresh1(team a, int b, int c)
 {
     CombatTime = .5f;
 }
Exemple #10
0
        private void Datagr_CurrentCellChanged(object sender, EventArgs e, bool isadm, string username)
        {
            WPFContext context = new WPFContext();

            try
            {
                var LastID = context.Teams.OrderByDescending(a => a.ID).FirstOrDefault().ID;
                if ((datagr.SelectedIndex + 1) > LastID)
                {
                    team t = new team();
                    t.ID = LastID + 1;
                    context.Teams.Add(t);
                }
                DataGridRow  r         = (DataGridRow)datagr.ItemContainerGenerator.ContainerFromIndex(datagr.SelectedIndex);
                DataGridCell RowColumn = datagr.Columns[datagr.CurrentColumn.DisplayIndex].GetCellContent(r).Parent as DataGridCell;
                string       CellValue = ((TextBlock)RowColumn.Content).Text;



                if ((datagr.SelectedIndex + 1) > LastID && (datagr.SelectedIndex + 1) < 20)
                {
                    team t = new team();
                    t.ID = LastID + 1;
                    context.Teams.Add(t);
                    context.SaveChanges();
                }
                var team = context.Teams.First(a => a.Position == datagr.SelectedIndex + 1);

                if (datagr.CurrentColumn.DisplayIndex == 2)

                {
                    team.Club = CellValue;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }

                if (datagr.CurrentColumn.DisplayIndex == 4)

                {
                    int newg = Convert.ToInt32(CellValue);
                    team.Won = newg;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }
                if (datagr.CurrentColumn.DisplayIndex == 5)

                {
                    int newg = Convert.ToInt32(CellValue);
                    team.Drawn = newg;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }
                if (datagr.CurrentColumn.DisplayIndex == 6)

                {
                    int newg = Convert.ToInt32(CellValue);
                    team.Lost = newg;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }
                if (datagr.CurrentColumn.DisplayIndex == 7)

                {
                    int newg = Convert.ToInt32(CellValue);
                    team.GF = newg;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }
                if (datagr.CurrentColumn.DisplayIndex == 8)

                {
                    int newg = Convert.ToInt32(CellValue);
                    team.GA = newg;
                    context.SaveChanges();
                    OrderTeams();
                    fillpage(isadm, username);
                }
            }
            catch  { }
        }
Exemple #11
0
        public bool EditTeam(int id, string n, string d1, string d2, string c1, string c2)
        {
            team t = db.teams.Find(id);

            if (t == null)
            {
                return(false);
            }
            char   space          = ' ';
            int    pos            = d1.IndexOf(space);
            string driver1Name    = d1.Substring(0, pos);
            string driver1SurName = d1.Substring(pos + 1);

            //
            pos = d2.IndexOf(space);
            string driver2Name    = d1.Substring(0, pos);
            string driver2SurName = d1.Substring(pos + 1);

            //
            pos = c1.IndexOf(space);
            string c1Power = c1.Substring(0, pos + 1);
            string tmp     = c1.Substring(pos + 1);

            c1  = tmp;
            pos = c1.IndexOf(space);
            string c1Res = c1.Substring(0, pos);

            tmp = c1.Substring(pos + 1);
            c1  = tmp;
            pos = c1.IndexOf(space);
            string c1Fuel       = c1.Substring(0, pos);
            string c1Weight     = c1.Substring(pos + 1);
            int    car1Power    = Convert.ToInt32(c1Power);
            int    car1Resourse = Convert.ToInt32(c1Res);
            double car1Fuel     = Convert.ToDouble(c1Fuel);
            double car1Weight   = Convert.ToDouble(c1Weight);

            //
            pos = c2.IndexOf(space);
            string c2Power = c2.Substring(0, pos + 1);

            tmp = c2.Substring(pos + 1);
            c2  = tmp;
            pos = c2.IndexOf(space);
            string c2Res = c2.Substring(0, pos);

            tmp = c2.Substring(pos + 1);
            c2  = tmp;
            pos = c2.IndexOf(space);
            string c2Fuel       = c2.Substring(0, pos);
            string c2Weight     = c2.Substring(pos + 1);
            int    car2Power    = Convert.ToInt32(c2Power);
            int    car2Resourse = Convert.ToInt32(c2Res);
            double car2Fuel     = Convert.ToDouble(c2Fuel);
            double car2Weight   = Convert.ToDouble(c2Weight);

            try
            {
                driver dr1 = db.drivers.Where(e => e.name.Equals(driver1Name) && (e.family_name.Equals(driver1SurName))).FirstOrDefault();
                driver dr2 = db.drivers.Where(e => e.name.Equals(driver2Name) && (e.family_name.Equals(driver2SurName))).FirstOrDefault();
                car    cr1 = db.cars.Where(e => (e.power_eng == car1Power) && (e.resourse == car1Resourse) && (e.fuel_eff == car1Fuel) && (e.car_weight == car1Weight)).FirstOrDefault();
                car    cr2 = db.cars.Where(e => (e.power_eng == car2Power) && (e.resourse == car2Resourse) && (e.fuel_eff == car2Fuel) && (e.car_weight == car2Weight)).FirstOrDefault();
                t.name    = n;
                t.driver1 = dr1.id;
                t.driver2 = dr2.id;
                t.car1    = cr1.id;
                t.car2    = cr2.id;
                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #12
0
        public static IEnumerable <player> AllPlayersForYear(this team team, year year)
        {
            var allPlayersForYear = team.playeryeardatas.Where(x => x.year.id == year.id).ToList();

            return(allPlayersForYear.Where(x => x.player.validPlayer).Select(x => x.player));
        }
Exemple #13
0
        public static IEnumerable <result> AllResultsForYear(this team team, year year, week week = null)
        {
            var seasonIndex = week == null ? 50 : week.seasonIndex;

            return(team.results.Where(x => x.year.value == year.value && x.match.teammatchup.week.seasonIndex < seasonIndex && x.IsComplete()));
        }
Exemple #14
0
        private void SaveButtonClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TeamNameResultText.Text) && string.IsNullOrEmpty(TeamNameField.Text))
            {
                MessageBox.Show("Введите название команды!");
                return;
            }

            var context           = new PSOConnect();
            var lol               = DoctorField.SelectedItem.ToString().Split('-');
            var lol2              = int.Parse(string.IsNullOrEmpty(DoctorResultText.Text)? DoctorField.SelectedItem.ToString().Split('-')[0] : DoctorResultText.Text.Split('-')[0]);
            var searchTeam        = context.teamPosition.FirstOrDefault(team => team.idTeam == Login.CurrentUser.idTeam);
            var idSeniorLifeguard = SeniorLifeguardField.Items.Count == 0 && string.IsNullOrEmpty(SeniorLifeguardResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(SeniorLifeguardResultText.Text) ? SeniorLifeguardField.SelectedItem.ToString().Split('-')[0] : SeniorLifeguardResultText.Text.Split('-')[0]);
            var idDoctor          = DoctorField.Items.Count == 0 && string.IsNullOrEmpty(DoctorResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(DoctorResultText.Text) ? DoctorField.SelectedItem.ToString().Split('-')[0] : DoctorResultText.Text.Split('-')[0]);
            var idParamedic       = ParamedicField.Items.Count == 0 && string.IsNullOrEmpty(ParamedicResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(ParamedicResultText.Text) ? ParamedicField.SelectedItem.ToString().Split('-')[0] : ParamedicResultText.Text.Split('-')[0]);
            var idDriver          = DriverField.Items.Count == 0 && string.IsNullOrEmpty(DriverResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(DriverResultText.Text) ? DriverField.SelectedItem.ToString().Split('-')[0] : DriverResultText.Text.Split('-')[0]);
            var idPyrotechnic     = PyrotechnicField.Items.Count == 0 && string.IsNullOrEmpty(PyrotechnicResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(PyrotechnicResultText.Text) ? PyrotechnicField.SelectedItem.ToString().Split('-')[0] : PyrotechnicResultText.Text.Split('-')[0]);
            var idGasWelder       = GasWelderField.Items.Count == 0 && string.IsNullOrEmpty(GasWelderResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(GasWelderResultText.Text) ? GasWelderField.SelectedItem.ToString().Split('-')[0] : GasWelderResultText.Text.Split('-')[0]);
            var idCraneOperator   = CraneOperatorField.Items.Count == 0 && string.IsNullOrEmpty(CraneOperatorResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(CraneOperatorResultText.Text) ? CraneOperatorField.SelectedItem.ToString().Split('-')[0] : CraneOperatorResultText.Text.Split('-')[0]);
            var idDiver           = DiverField.Items.Count == 0 && string.IsNullOrEmpty(DiverResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(DiverResultText.Text) ? DiverField.SelectedItem.ToString().Split('-')[0] : DiverResultText.Text.Split('-')[0]);
            var idHydraulic       = HydraulicField.Items.Count == 0 && string.IsNullOrEmpty(HydraulicResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(HydraulicResultText.Text) ? HydraulicField.SelectedItem.ToString().Split('-')[0] : SeniorLifeguardResultText.Text.Split('-')[0]);
            var idScout           = ScoutField.Items.Count == 0 && string.IsNullOrEmpty(ScoutResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(ScoutResultText.Text) ? ScoutField.SelectedItem.ToString().Split('-')[0] : ScoutResultText.Text.Split('-')[0]);
            var idElectrician     = ElectricianField.Items.Count == 0 && string.IsNullOrEmpty(ElectricianResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(ElectricianResultText.Text) ? ElectricianField.SelectedItem.ToString().Split('-')[0] : ElectricianResultText.Text.Split('-')[0]);
            var idRescuer         = RescuerField.Items.Count == 0 && string.IsNullOrEmpty(RescuerResultText.Text) ? null : (int?)int.Parse(string.IsNullOrEmpty(RescuerResultText.Text) ? RescuerField.SelectedItem.ToString().Split('-')[0] : RescuerResultText.Text.Split('-')[0]);
            var teamName          = string.IsNullOrEmpty(TeamNameResultText.Text) ? TeamNameField.Text : TeamNameResultText.Text;

            if (searchTeam == null)
            {
                var teamPosition = new teamPosition
                {
                    idTeam          = context.teamPosition.Count() > 0 ? context.teamPosition.Max(team => team.idTeam) + 1 : 1,
                    seniorLifeguard = idSeniorLifeguard,
                    doctor          = idDoctor,
                    paramedic       = idParamedic,
                    driver          = idDriver,
                    pyrotechnist    = idPyrotechnic,
                    gasWelder       = idGasWelder,
                    craneOperator   = idCraneOperator,
                    scubaDriver     = idDiver,
                    hydraulicEquipmentTechnician = idHydraulic,
                    scout       = idScout,
                    electrician = idElectrician,
                    rescuer     = idRescuer
                };

                var currentTeam = new team
                {
                    idTeam   = context.team.Count() > 0 ? context.team.Max(team => team.idTeam) + 1 : 1,
                    teamName = teamName
                };

                var coordinator = new coordinator
                {
                    idTeam = context.coordinator.Count() > 0 ? context.coordinator.Max(team => team.idTeam) + 1 : 1,
                };

                var currentCoordinator = context.user.FirstOrDefault(user => user.login.Equals(Login.CurrentUser.login));
                currentCoordinator.idTeam = currentTeam.idTeam;
                Login.CurrentUser         = currentCoordinator;
                context.coordinator.Add(coordinator);
                context.team.Add(currentTeam);
                context.teamPosition.Add(teamPosition);
            }
            else
            {
                searchTeam.seniorLifeguard = idSeniorLifeguard;
                searchTeam.doctor          = idDoctor;
                searchTeam.paramedic       = idParamedic;
                searchTeam.driver          = idDriver;
                searchTeam.pyrotechnist    = idPyrotechnic;
                searchTeam.gasWelder       = idGasWelder;
                searchTeam.craneOperator   = idCraneOperator;
                searchTeam.scubaDriver     = idDiver;
                searchTeam.hydraulicEquipmentTechnician = idHydraulic;
                searchTeam.scout       = idScout;
                searchTeam.electrician = idElectrician;
                searchTeam.rescuer     = idRescuer;

                var currentTeam = context.team.FirstOrDefault(team => team.idTeam == Login.CurrentUser.idTeam);

                currentTeam.teamName = teamName;
            }

            context.SaveChanges();
            ResetField();
            InitFields();
            MessageBox.Show("Команда успешно зарегистрирована!");
        }
Exemple #15
0
 public void setTeam(team _team)
 {
     myTeam = _team;
 }
 public void updateTeam(team team)
 {
     userRepository.updateTeam(team);
 }
Exemple #17
0
        // constructor
        public Player()
        {
            // assign nilai default atribut
            peerID      = "";
            position    = new Vector2();
            angle       = 3.14f;
            healthPoint = 100;
            Fire        = true;
            orientation = 0;

            // randomize jenis player (dari segi texture)
            Random random = new Random();

            Array jenis = Enum.GetValues(typeof(jenisPlayer));

            currentPlayer = (jenisPlayer)jenis.GetValue(random.Next(jenis.Length));

            // randomize team
            Array tim = Enum.GetValues(typeof(team));

            myTeam = (team)tim.GetValue(random.Next(tim.Length));

            // check team max player
            if (myTeam == team.redTeam)
            {
                if (redTeamCount < max_player / 2)
                {
                    redTeamCount++;
                }
                else
                {
                    myTeam = team.blueTeam;
                    blueTeamCount++;
                }
            }
            else
            {
                if (blueTeamCount < max_player / 2)
                {
                    blueTeamCount++;
                }
                else
                {
                    myTeam = team.redTeam;
                    redTeamCount++;
                }
            }

            // Texturing pointer
            if (myTeam == team.redTeam) // red pointer
            {
                pointerTexture = AssetsManager.AssetsList["redPointer"];
            }
            else // blue pointer
            {
                pointerTexture = AssetsManager.AssetsList["bluePointer"];
            }

            if (currentPlayer == jenisPlayer.player1)
            {
                playerTexture = AssetsManager.AssetsList["orang1"];
            }
            if (currentPlayer == jenisPlayer.player2)
            {
                playerTexture = AssetsManager.AssetsList["orang2"];
            }
            if (currentPlayer == jenisPlayer.player3)
            {
                playerTexture = AssetsManager.AssetsList["orang3"];
            }
            if (currentPlayer == jenisPlayer.player4)
            {
                playerTexture = AssetsManager.AssetsList["orang4"];
            }
        }
Exemple #18
0
 public void setTeam(team team)
 {
     Debug.Log("setTeam Called");
     playersTeam = team;
     actorSelf.setTeam(team);
 }
Exemple #19
0
 public TeamRoster(team team)
 {
     this.Team    = team;
     this.players = new List <string>(10);
 }
Exemple #20
0
 public void joinTeam(team i)
 {
     myTeam = i;
 }
Exemple #21
0
 public TeamRoster(team team, IEnumerable <string> players)
 {
     this.Team    = team;
     this.players = players.ToList();
 }
        public ActionResult addPlayer(long?id)
        {
            team t = db.teams.Find(id);

            return(RedirectToAction("Create", "players", new player(teamId:  t.id)));
        }
Exemple #23
0
 public void setTeam(team team)
 {
     playersTeam = team;
     actorSelf.setTeam(team);
 }
 private void nullPing2(team s, int o, int i)
 {
     //Do nothing
 }
Exemple #25
0
        public ScheduleTeamMatchup(teammatchup tm)
        {
            int numOfTeams = tm.teams.Count;

            this.MatchOrder = tm.matchOrder;

            team team1 = numOfTeams > 0 ? tm.teams.First() : null;
            team team2 = numOfTeams > 1 ? tm.teams.Skip(1).First() : null;

            if (team1 != null)
            {
                this.Team1       = TeamResponse.From(team1);
                this.Team1Points = tm.PointsFor(team1);
                this.Team1Win    = tm.Team1Won();
            }

            if (team2 != null)
            {
                this.Team2       = TeamResponse.From(team2);
                this.Team2Points = tm.PointsFor(team2);
                this.Team2Win    = tm.Team2Won();
            }

            this.IsComplete  = tm.IsComplete();
            this.TeeTimeText = tm.TeeTimeText();
            this.Id          = tm.id;
            this.PlayoffType = tm.playoffType;

            if (this.IsComplete && team1 != null && team2 != null)
            {
                result team1PointsResult = tm.TopPoints(team1);
                //result team2PointsResult = tm.TopPoints(team2);

                this.TopPoints = team1PointsResult != null ?
                                 new MatchSummaryValue
                {
                    Player         = new PlayerWebResponse(team1PointsResult.player),
                    FormattedValue = LeaderBoardFormat.Default.FormatValue(team1PointsResult.points),
                    Value          = (double)team1PointsResult.points
                } : null;


                result topNetScore = tm.TopNetDifference(team1);

                this.TopNetScore = topNetScore != null ?
                                   new MatchSummaryValue
                {
                    Player         = new PlayerWebResponse(topNetScore.player),
                    FormattedValue = LeaderBoardFormat.Net.FormatValue(topNetScore.NetScoreDifference()),
                    Value          = (double)topNetScore.NetScoreDifference()
                } : null;

                //this.Team2TopPoints = team2PointsResult != null ?
                //    new MatchSummaryValue
                //    {
                //        Player = new PlayerWebResponse(team2PointsResult.player),
                //        FormattedValue = LeaderBoardFormat.Default.FormatValue(team2PointsResult.points),
                //        Value = (double)team2PointsResult.points
                //    } : null;
            }
        }
Exemple #26
0
 // Llenar los datos seleccionados
 private void fillSelectedData(team currentTeam)
 {
     // Le damos el valor del equipo seleccionado accediendo a su propiedad
     txtName.Text = currentTeam.team_name;
 }
Exemple #27
0
 public void setTeam(team _team)
 {
     myTeam = _team;
 }
Exemple #28
0
 public BuildProcess()
 {
     myHouse = new House();
     myTeam  = new team();
 }
Exemple #29
0
        // constructor
        public Player()
        {
            // assign nilai default atribut
            peerID = "";
            position = new Vector2();
            angle = 3.14f;
            healthPoint = 100;
            Fire = true;
            orientation = 0;

            // randomize jenis player (dari segi texture)
            Random random = new Random();

            Array jenis = Enum.GetValues(typeof(jenisPlayer));
            currentPlayer = (jenisPlayer)jenis.GetValue(random.Next(jenis.Length));

            // randomize team
            Array tim = Enum.GetValues(typeof(team));
            myTeam = (team)tim.GetValue(random.Next(tim.Length));

            // check team max player
            if (myTeam == team.redTeam)
            {
                if (redTeamCount < max_player / 2)
                {
                    redTeamCount++;
                }
                else
                {
                    myTeam = team.blueTeam;
                    blueTeamCount++;
                }
            }
            else
            {
                if (blueTeamCount < max_player / 2)
                {
                    blueTeamCount++;
                }
                else
                {
                    myTeam = team.redTeam;
                    redTeamCount++;
                }
            }

            // Texturing pointer
            if (myTeam == team.redTeam) // red pointer
            {
                pointerTexture = AssetsManager.AssetsList["redPointer"];
            }
            else // blue pointer
            {
                pointerTexture = AssetsManager.AssetsList["bluePointer"];
            }

            if (currentPlayer == jenisPlayer.player1) { playerTexture = AssetsManager.AssetsList["orang1"]; }
            if (currentPlayer == jenisPlayer.player2) { playerTexture = AssetsManager.AssetsList["orang2"]; }
            if (currentPlayer == jenisPlayer.player3) { playerTexture = AssetsManager.AssetsList["orang3"]; }
            if (currentPlayer == jenisPlayer.player4) { playerTexture = AssetsManager.AssetsList["orang4"]; }
        }
Exemple #30
0
 public Bishop(string rank, team team, int position, string pictureName, bool isActive)
     : base(rank, team, position, pictureName, isActive)
 {
 }
 public void RemoveTeam(team removed)
 {
     colorList.Add(removed.colors);
     teams.Remove(removed);
 }
Exemple #32
0
        private void TeamsSync(int EventId, Dictionary<string, team> TeamsList)
        {
            StatusChange("Syncing Teams");

            var TeamsListUpdated = new Dictionary<string, team>();
            var lst = teamsRepo.GetTeamsByEvent(EventId);
            foreach (string teamName in TeamsList.Keys)
            {
                bool found = false;
                if (lst.Count() > 0)
                {
                    found = (lst.Any(x => x.team_name.Contains(teamName)));
                }
                if (!found)
                {
                    var newTeam = new team();
                    newTeam.lsevent_id = EventId;
                    newTeam.team_name = teamName;
                    TeamsListUpdated[teamName] = teamsRepo.Insert(newTeam);
                }
                else
                {
                    TeamsListUpdated[teamName] = lst.First(x => x.team_name == teamName);
                }
            }
            StatusChange("... " + TeamsListUpdated.Count().ToString() + " Synced");
            this.TeamList = TeamsListUpdated;
        }
 public void insertTeam(team team)
 {
     userRepository.insertTeam(team);
 }