Package ingsw.proj.cluedo.componenti

Examples of ingsw.proj.cluedo.componenti.CasellaPorta


    for (int i = 0; i < caselle.length; i++)
      for (int j = 0; j < caselle[0].length; j++) {
        caselle[i][j] = new Casella(StanzeEnum.CORRIDOIO, new Point(j, i));
      }
    // Le Porte
    caselle[2][4] = new CasellaPorta(StanzeEnum.CAMERA_LETTO, new Point(4, 2), new Point(5,2));
    caselle[2][5] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(5, 2), new Point(4,2));
    caselle[5][9] = new CasellaPorta(StanzeEnum.SALA_GIOCHI, new Point(9, 5), new Point(9,6));
    caselle[6][9] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(9, 6), new Point(9,5));
    caselle[6][15] = new CasellaPorta(StanzeEnum.BIBLIOTECA, new Point(15, 6), new Point(15,7));
    caselle[7][15] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(15, 7), new Point(15,6));
    caselle[3][20] = new CasellaPorta(StanzeEnum.STUDIO, new Point(20, 3), new Point(19,3));
    caselle[3][19] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(19, 3), new Point(20,3));
    caselle[12][6] = new CasellaPorta(StanzeEnum.SALA, new Point(6, 12), new Point(7,12));
    caselle[12][7] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(7, 12), new Point(6,12));
    caselle[11][17] = new CasellaPorta(StanzeEnum.INGRESSO, new Point(17, 11), new Point(16,11));
    caselle[11][16] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(16, 11), new Point(17,11));
    caselle[19][5] = new CasellaPorta(StanzeEnum.CUCINA, new Point(5, 19), new Point(6,19));
    caselle[19][6] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(6, 19), new Point(5,19));
    caselle[16][11] = new CasellaPorta(StanzeEnum.BAGNO, new Point(11, 16), new Point(11,15));
    caselle[15][11] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(11, 15), new Point(11,16));
    caselle[20][19] = new CasellaPorta(StanzeEnum.CANTINA, new Point(19, 20), new Point(18,20));
    caselle[20][18] = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(18, 20), new Point(19,20));
    // I Passaggi Segreti
    // TODO AGGIUNGERE I PASSAGGI SEGRETI
    caselle[0][0] = new CasellaPassaggioSegreto(StanzeEnum.CAMERA_LETTO, new Point(0, 0), new Point(23, 23));
    caselle[23][23] = new CasellaPassaggioSegreto(StanzeEnum.CANTINA, new Point(23, 23), new Point(0, 0));
    caselle[0][23] = new CasellaPassaggioSegreto(StanzeEnum.STUDIO, new Point(23, 0), new Point(0, 23));
View Full Code Here


  private List<Casella> getPossibiliDestinazioni(Casella partenza) {
    ArrayList<Casella> dest = new ArrayList<Casella>();
    if (partenza != null) {
      if (partenza instanceof CasellaPorta) {
        CasellaPorta destinazione = (CasellaPorta) tabellone.getCasella(((CasellaPorta) partenza).getDestinazione());
        if (VerificaDestinazione((CasellaPorta) partenza, destinazione))
          dest.add(destinazione);
      }

      if (partenza instanceof CasellaPassaggioSegreto) {
View Full Code Here

  private Casella destinazione;

  @Before
  public void setUp() throws Exception {
    destinazione = new Casella(StanzeEnum.CAMERA_LETTO, new Point(3, 2));
    casella = new CasellaPorta(StanzeEnum.CORRIDOIO, new Point(3, 4), new Point(3,2));
  }
View Full Code Here

    assertTrue(casella instanceof Casella);
  }

  @Test(expected = NullPointerException.class)
  public void testCasellaPortaNull() {
    new CasellaPorta(null, new Point(2, 3), new Point(2,3));
    new CasellaPorta(StanzeEnum.CAMERA_LETTO, new Point(2, 3), null);
    new CasellaPorta(null, null, null);
  }
View Full Code Here

TOP

Related Classes of ingsw.proj.cluedo.componenti.CasellaPorta

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.