Ejemplo n.º 1
0
 private void LoadPlayerScores()
 {
     allScores = new GameScores();
     allScores.Start();
     LoadGoodPlayerScores();
     LoadBadPlayerScores();
 }
Ejemplo n.º 2
0
 public void WhenTheGameIsScored()
 {
     var gameBinding = Binding<GameStateBindings>();
     _game = gameBinding.Game;
     _game.Score();
     _scores = _game.Scores;
 }
Ejemplo n.º 3
0
        public void WhenTheGameIsScored()
        {
            var gameBinding = Binding <GameStateBindings>();

            _game = gameBinding.Game;
            _game.Score();
            _scores = _game.Scores;
        }
Ejemplo n.º 4
0
        public void Add(GameScores score)
        {
            Scores.Add(score);

            Scores = Scores.OrderByDescending(c => c.Games).ToList(); // Orders the list so that the higher scores are first

            UpdateHighscores();
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     gameScores                   = GetComponent <GameScores>();
     gameCombo                    = GetComponent <GameCombo>();
     gameCoins                    = GetComponent <GameCoins>();
     gamePlanetProgress           = GetComponent <GamePlanetProgress>();
     GameManager.ChangeModeEvent += ChangeMode;
 }
Ejemplo n.º 6
0
 public GameResultsViewModel(GameScores scores)
 {
     Winner = scores.Winner.Name;
     Scores = scores
              .Select(s => new PlayerResultViewModel {
         PlayerName = s.Key.Name, Score = s.Value
     })
              .ToArray();
 }
Ejemplo n.º 7
0
 public override void Update(PD_Game game, PD_AI_PathFinder pathFinder)
 {
     GameSettings.Update(game, pathFinder);
     GameCondition.Update(game, pathFinder);
     GameScores.Update(game, pathFinder);
     ActionStats.Update(game, pathFinder);
     GameStateEvaluationMetrics.Update(game, pathFinder);
     MapStats.Update(game, pathFinder);
 }
    public static void EnemyShot(GameField matrix, List <List <int> > enemyCoords, DateTime saveStartTime)
    {
        bool shot;
        int  row = 0;
        int  col = 0;

        for (int i = 0; i < enemyCoords.Count; i++)
        {
            row = enemyCoords[i][0];
            col = enemyCoords[i][1];


            if ((row == Player.row - 1 && col == Player.col) ||
                (row == Player.row - 2 && col == Player.col))
            {
                matrix[Enemy.enemyRow, Enemy.enemyCol] = ' ';
                enemyCoords.RemoveAt(i);
                shot = true;
                GameScores.CollisionScores(shot, saveStartTime);
            }
            else if ((row == Player.row + 1 && col == Player.col) ||
                     (row == Player.row + 2 && col == Player.col))
            {
                matrix[Enemy.enemyRow, Enemy.enemyCol] = ' ';
                enemyCoords.RemoveAt(i);
                shot = true;
                GameScores.CollisionScores(shot, saveStartTime);
            }
            else if ((col == Player.col + 1 && row == Player.row) ||
                     (Enemy.enemyCol == Player.col + 2 && Enemy.enemyCol == Player.col))
            {
                matrix[Enemy.enemyRow, Enemy.enemyCol] = ' ';
                enemyCoords.RemoveAt(i);
                shot = true;
                GameScores.CollisionScores(shot, saveStartTime);
            }
            else if ((col == Player.col - 1 && row == Player.row) ||
                     (col == Player.col - 2 && row == Player.row))
            {
                matrix[Enemy.enemyRow, Enemy.enemyCol] = ' ';
                enemyCoords.RemoveAt(i);
                shot = true;
                GameScores.CollisionScores(shot, saveStartTime);
            }
        }
    }
Ejemplo n.º 9
0
        public void LogGameEnd(GameScores scores)
        {
            _builder
                .AppendLine("The game has ended!")
                .AppendLine()
                .AppendLine("----- SCORES -----");

            foreach (var item in scores)
                _builder
                    .AppendFormat("{0}: {1}", item.Key.Name, item.Value)
                    .AppendLine();

            _builder.AppendLine();            

            var winner = scores.Winner;                                

            _builder.AppendLine();
            _builder.AppendLine(winner.Name + " is the winner!");


        }
    public static void EatenByEnemy(GameField matrix, List <List <int> > enemyCoords, DateTime saveStartTime)
    {
        int row = 0;
        int col = 0;

        for (int i = 0; i < enemyCoords.Count; i++)
        {
            row = enemyCoords[i][0];
            col = enemyCoords[i][0];
            bool eaten = true;
            if (((Player.row + 1 == row) && (Player.col == col)) ||
                ((Player.row == row) && (Player.col + 1 == col)) ||
                ((Player.row - 1 == row) && (Player.col == col)) ||
                ((Player.row == row) && (Player.col - 1 == col)))
            {
                eaten = false;
                enemyCoords.RemoveAt(i);
                matrix[row, col] = ' ';
                GameScores.CollisionScores(eaten, saveStartTime);
                //GameScores.CollisionScores(false, saveStartTime);
            }
        }
    }
Ejemplo n.º 11
0
        public GameScores Score()
        {
            var scores = new GameScores(this);

            foreach(var player in Players)
                scores.Score(player);                

            return scores;
        }
Ejemplo n.º 12
0
 public static void SaveOptions(GameScores options) => Streamer.SaveOptions(options);
Ejemplo n.º 13
0
 void Awake()
 {
     _instance = this;
 }
Ejemplo n.º 14
0
 public GameResultsViewModel(GameScores scores)
 {
     Winner = scores.Winner.Name;
     Scores = scores
         .Select(s => new PlayerResultViewModel {PlayerName = s.Key.Name, Score = s.Value})
         .ToArray();
 }
Ejemplo n.º 15
0
        public void Score()
        {
            Scores = new GameScores(this);

            foreach(var player in Players)
                Scores.Score(player);                
        }