public List <CellOutcome> visit(BombAttack bombAttack)
 {
     for (int i = 2; i < 15; i += 5)
     {
         for (int j = 2; j < 15; j += 5)
         {
             outcomes.AddRange(bombAttack.Attack(i, j, cells, ships));
         }
     }
     return(outcomes);
 }
Example #2
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        IDamageable damageable = collision.gameObject.GetComponent <IDamageable>();

        if (damageable != null)
        {
            bombAttack.Attack(damageable);
        }


        ExplodeBomb(collision.gameObject.transform.position);
    }