Exemple #1
0
        public void ManageTournamentMatch(UpdateGame matchresult)
        {
            string dataBaseResult  = matchresult.GoalsTeamOne + "," + matchresult.GoalsTeamTwo;
            bool   isTeamOneWinner = false;
            bool   isPlayed;

            if (matchresult.GoalsTeamOne > matchresult.GoalsTeamTwo)
            {
                isTeamOneWinner = true;
            }
            else
            {
                isTeamOneWinner = false;
            }

            dataManager.updateTourMatch(true, isTeamOneWinner, matchresult.TournamentGameId, dataBaseResult);

            var allTourGames = dataManager.getTournamentGamesByTourId(matchresult.TournamentId);

            var firstEmptySpotGame = allTourGames.Where(o => o.teamOne.Name == null || o.teamTwo.Name == null).Where(o => o.TournamentRound - 1 == dataManager.getTournamentMatchByid(matchresult.TournamentGameId).TournamentRound).FirstOrDefault();

            var tourMatch = dataManager.getTournamentMatchByid(matchresult.TournamentGameId);

            if (firstEmptySpotGame != null)
            {
                if (isTeamOneWinner)
                {
                    setTeamForNewRound(firstEmptySpotGame.Id, tourMatch.teamOne);
                }
                else
                {
                    setTeamForNewRound(firstEmptySpotGame.Id, tourMatch.teamTwo);
                }
            }
        }
Exemple #2
0
 public Game(EndGame endGame, UpdateGame updateGame, Client client1, Client client2)
 {
     this.endGame    = endGame;
     this.updateGame = updateGame;
     this.client1    = client1;
     this.client2    = client2;
     startTime       = DateTime.Now;
 }
Exemple #3
0
        private void txtUGame_Click(object sender, EventArgs e)
        {
            UpdateGame uGame = new UpdateGame();

            uGame.Show();
            uGame.name(txtName.Text);
            uGame.logName(button1.Text);
            this.Close();
        }
 public int oldScore;// = s + spawnMult;
 // This script will simply instantiate the Prefab when the game starts.
 void Start()
 {
     Application.targetFrameRate = 60;
     //spawnMobs(gCount,lCount,bCount, sCount);
     //m = GameObject.Find("Mob");
     //public List <GameObject> enemies = new List<GameObject>();
     updater  = GameObject.Find("update");
     ug       = updater.GetComponent <UpdateGame>();
     oldScore = s + spawnMult;
     //oldScore = (s + spawnMult);
 }
Exemple #5
0
 private void Awake()
 {
     if (instance = null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        GameObject thisScript = GameObject.Find("update");

        theGame = thisScript.GetComponent <UpdateGame>();
    }