Exemple #1
0
    /// <summary>
    /// Gets the player to attack the indicated row and column.
    /// </summary>
    /// <param name="row">the row to attack</param>
    /// <param name="col">the column to attack</param>
    /// <remarks>
    /// Checks the attack result once the attack is complete
    /// </remarks>
    public static void Attack(int row, int col)
    {
        AttackResult result = default(AttackResult);

        result = _theGame.Shoot(row, col);
        CheckAttackResult(result);
    }
Exemple #2
0
    // '' <summary>
    // '' Gets the player to attack the indicated row and column.
    // '' </summary>
    // '' <param name="row">the row to attack</param>
    // '' <param name="col">the column to attack</param>
    // '' <remarks>
    // '' Checks the attack result once the attack is complete
    // '' </remarks>
    public static void Attack(int row, int col)
    {
        AttackResult result;

        result = _theGame.Shoot(row, col);
        GameController.CheckAttackResult(result);
    }
Exemple #3
0
    /// <summary>
    /// Attack the specified row and col.
    /// </summary>
    /// <param name="row">Row.</param>
    /// <param name="col">Col.</param>
    public static void Attack(int row, int col)
    {                                                                                                                   /*Gets the player to attack the indicated row and column,
                                                                                                                         * and then Checks the attack result once the attack is complete*/
        AttackResult result = default(AttackResult);

        result = _theGame.Shoot(row, col);
        CheckAttackResult(result);
    }
Exemple #4
0
 public void TestHere()
 {
     _loadedGame.AddDeployedPlayer(_humanPlayer);
     _loadedGame.Player.EnemyGrid.HitTile(1, 3);
     _loadedGame.Shoot(1, 2);
     //GameController.SetDifficulty(AIOption.Hard);
     //Assert.AreEqual(_game.getOption, GameController.Difficulty);
     //TestContext.WriteLine(_game.getOption);
     //TestContext.WriteLine(GameController.Difficulty);
     // _game.getOption == GameController.ComputerPlayer.
 }
Exemple #5
0
    /// <summary>
    /// Gets the player to attack the indicated row and column.
    /// </summary>
    /// <param name="row">the row to attack</param>
    /// <param name="col">the column to attack</param>
    /// <remarks>
    /// Checks the attack result once the attack is complete
    /// </remarks>
    public static void Attack(int row, int col)
    {
        if (isClicked(row, col))
        {
            return;
        }

        clickedPoints.Add(new Point(row, col));
        AttackResult result = default(AttackResult);

        result = _theGame.Shoot(row, col);
        CheckAttackResult(result);
    }
Exemple #6
0
    /// <summary>
    /// Gets the player to attack the indicated row and column.
    /// </summary>
    /// <param name="row">the row to attack</param>
    /// <param name="col">the column to attack</param>
    /// <remarks>
    /// Checks the attack result once the attack is complete
    /// </remarks>
    public static void Attack(int row, int col)
    {
        if (row == -1)
        {
            if (col == 0 || col == 1)
            {
                GameController.AddNewState(GameState.ViewingGameMenu);
                return;
            }
            return;
        }

        AttackResult result = default(AttackResult);

        result = _theGame.Shoot(row, col);
        CheckAttackResult(result);
    }