Ejemplo n.º 1
0
 public static void FireEndGame(object sender, EndGameEventArgs e)
 {
     if (EventSystem.OnEndGame != null)
     {
         EventSystem.OnEndGame(sender, e);
     }
 }
Ejemplo n.º 2
0
 public static void FireEndGame(object sender, EndGameEventArgs e)
 {
     if (EventSystem.OnEndGame != null)
     {
         EventSystem.OnEndGame(sender, e);
     }
 }
Ejemplo n.º 3
0
        private void EndGameActionHandler(object sender, EndGameEventArgs args)
        {
            int           points     = args.Points;
            EndGameWindow endGameWnd = new EndGameWindow(points);

            endGameWnd.Show();
            this.window.Close();
        }
Ejemplo n.º 4
0
    private void EndGame(EndGameEventArgs args)
    {
        // for now, this does nothing
        OnEndGame.Invoke(args);
        GameInProgress = false;

        Time.timeScale = 0.0f;
    }
Ejemplo n.º 5
0
        public void OnEndGame()
        {
            EndGameEventArgs arg = new EndGameEventArgs();

            if (endGameEvent != null)
            {
                Logger.LogMessage("Player " + this.Id.ToString() + " game ends");
                endGameEvent(this, arg);
            }
        }
Ejemplo n.º 6
0
 private async void ViewModel_EndGameEvent(object sender, EndGameEventArgs e)
 {
     if (e.SideWin == 1)
     {
         await DisplayAlert("Endgame", "Player 1 Win", "Ok");
     }
     else if (e.SideWin == 2)
     {
         await DisplayAlert("Endgame", "Player 2 Win", "Ok");
     }
 }
Ejemplo n.º 7
0
        public static void RemovePlayer(object source, EndGameEventArgs arg)
        {
            int    outPlayerId = (source as Player).Id;
            Player outPlayer   = (from p in players
                                  where p.Id == outPlayerId
                                  select p).First();

            Logger.LogMessage("EP removing Player " + outPlayerId.ToString());
            ReWireEvents(outPlayer);
            players.Remove(outPlayer);
            Logger.LogMessage("EP Player " + outPlayerId.ToString() + " removed");
        }
Ejemplo n.º 8
0
    protected void WastedAllBallsEnd(object sender, EndGameEventArgs e)
    {
        Time.timeScale = 0;
        MainHelper mh          = GameObject.Find("MainHelper").GetComponent <MainHelper>();
        Game       currentGame = mh.GetCurrentGame();

        currentGame.GameInProgress = false;

        GameObject ballObj = null;

        ballObj = GameObject.Find("Ball");

        GameObject.Find("Morpher").GetComponent <Morpher>().KillTheBall();
    }
Ejemplo n.º 9
0
        private void EndGame(object sender, System.EventArgs eventArgs)
        {
            EndGameEventArgs endGameEventArgs = eventArgs as EndGameEventArgs;

            if (endGameEventArgs != null && this.client != null)
            {
                this.client.SendMessage(new
                {
                    type         = MESSAGE_TYPE_MATCH_END_GAME,
                    myUnities    = endGameEventArgs.MyUnities,
                    enemyUnities = endGameEventArgs.EnemyUnities
                });
            }
        }
Ejemplo n.º 10
0
 protected void IncBallNum(object sender, BallCrushedEventArgs e)
 {
     if (this.currentBall <= this.totalBalls)
     {
         ++this.currentBall;
         InterfaceUpdateEventArgs ev = new InterfaceUpdateEventArgs(InterfaceUpdateReasons.BallLost, string.Empty);
         EventSystem.FireInterfaceUpdate(this, ev);
     }
     else
     {
         object           snd = new object();
         EndGameEventArgs ev  = new EndGameEventArgs(this.highScore, this.playerName, this.currentLevel, EndGameReasons.WastedAllBalls);
         EventSystem.FireEndGame(snd, ev); // TODO: eventsystem game end event
     }
 }
Ejemplo n.º 11
0
    protected void EndGame(object sender, EndGameEventArgs e)
    {
        switch (e.EndReason)
        {
        case EndGameReasons.CompletedAllLevels:

            break;

        case EndGameReasons.WastedAllBalls:
            this.WastedAllBallsEnd(sender, e);
            break;

        case EndGameReasons.UnknownReason:

            break;
        }
    }
Ejemplo n.º 12
0
    protected void EndGame(object sender, EndGameEventArgs e)
    {
        switch (e.EndReason)
        {
            case EndGameReasons.CompletedAllLevels:

                break;
            case EndGameReasons.WastedAllBalls:
                this.WastedAllBallsEnd(sender, e);
                break;
            case EndGameReasons.UnknownReason:

                break;
        }
    }
Ejemplo n.º 13
0
 private void EnableEndScreen(EndGameEventArgs args)
 {
     Text.text = args.message;
     EndScreenObject.SetActive(true);
 }
Ejemplo n.º 14
0
    protected void WastedAllBallsEnd(object sender, EndGameEventArgs e)
    {
        Time.timeScale = 0;
        MainHelper mh = GameObject.Find("MainHelper").GetComponent<MainHelper>();
        Game currentGame = mh.GetCurrentGame();
        currentGame.GameInProgress = false;

        GameObject ballObj = null;

        ballObj = GameObject.Find("Ball");

        GameObject.Find("Morpher").GetComponent<Morpher>().KillTheBall();
    }
Ejemplo n.º 15
0
 public void OnDeathResolve(object sender, EndGameEventArgs e)
 {
     resolveDeathSprite = true;
     timeOfDeath = e.timeOfDeath;
 }
Ejemplo n.º 16
0
 private void EndTheGame(object sender, EndGameEventArgs e)
 {
     ChangedPage.Invoke(this, new ChangedPageEventArgs(new MainMenu()));
 }
Ejemplo n.º 17
0
 public void StartNewRound(object source, EndGameEventArgs arg)
 {
     this.hasPillow = true;
     Logger.LogMessage("Player " + this.Id.ToString() + " new round started");
 }
Ejemplo n.º 18
0
 protected void IncBallNum(object sender, BallCrushedEventArgs e)
 {
     if (this.currentBall <= this.totalBalls)
     {
         ++this.currentBall;
         InterfaceUpdateEventArgs ev = new InterfaceUpdateEventArgs(InterfaceUpdateReasons.BallLost, string.Empty);
         EventSystem.FireInterfaceUpdate(this, ev);
     }
     else
     {
         object snd = new object();
         EndGameEventArgs ev = new EndGameEventArgs(this.highScore, this.playerName, this.currentLevel, EndGameReasons.WastedAllBalls);
         EventSystem.FireEndGame(snd, ev); // TODO: eventsystem game end event
     }
 }