Esempio n. 1
0
        public void AfterNewSquareIsAddedHorizontallySquaresAreSortedByColumns()
        {
            SortedSquares s = new SortedSquares();

            s.Add(new Square(3, 4));
            s.Add(new Square(3, 3));
            Assert.AreEqual(new Square(3, 3), s.First());
            s.Add(new Square(3, 5));
            Assert.AreEqual(new Square(3, 5), s.Last());
        }
Esempio n. 2
0
        public void AfterNewSquareIsAddedVerticallySquaresAreSortedByRows()
        {
            SortedSquares s = new SortedSquares();

            s.Add(new Square(4, 4));
            s.Add(new Square(3, 4));
            Assert.AreEqual(new Square(3, 4), s.First());
            s.Add(new Square(5, 4));
            Assert.AreEqual(new Square(5, 4), s.Last());
        }
 public ShootingTacticsFactory(Grid evidenceGrid, SortedSquares squaresHit, List <int> shipsToShoot)
 {
     this.squaresHit   = squaresHit;
     this.evidenceGrid = evidenceGrid;
     this.shipsToShoot = shipsToShoot;
 }
Esempio n. 4
0
 public InlineShooting(Grid evidenceGrid, SortedSquares squaresHit, List <int> shipsToShoot)
 {
     this.squaresHit   = squaresHit;
     this.evidenceGrid = evidenceGrid;
     this.shipsToShoot = shipsToShoot;
 }