Examples of Casella


Examples of ingsw.proj.cluedo.componenti.Casella

      if (stanze.get(i).getNome() != StanzeEnum.CORRIDOIO)
        copia.add(stanze.get(i));
    Collections.shuffle(copia);
    for (int i = 0; i < numGioc; i++) {
      String nome = nomiGiocatori.get(i);
      Casella posizione = copia.get(i).getCasellaVuotaRandom();
      giocatori.add(new Giocatore(nome, posizione, mazzi.get(i)));
      giocatori.get(i).cambiaPosizione(posizione);
    }
  }
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

    for (int i = 0; i < stanze.size(); i++)
      if (stanze.get(i).getNome() != StanzeEnum.CORRIDOIO)
        copia.add(stanze.get(i));
    Collections.shuffle(copia);
    for (int i = 0; i < ArmiEnum.values().length; i++) {
      Casella posizione = copia.get(i).getCasellaVuotaRandom();
      pedineArmi.add(new Pedina(posizione, ArmiEnum.values()[i].toString()));
      pedineArmi.get(i).cambiaPosizione(posizione);
    }
  }
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  private void generaStanza(int xMin, int xMax, int yMin, int yMax, StanzeEnum nomeStanza) {
    ArrayList<Casella> tempStanza = new ArrayList<Casella>();
    for (int i = yMin; i <= yMax; i++)
      for (int j = xMin; j <= xMax; j++) {
        if (!(caselle[i][j] instanceof HaDestinazione))
          caselle[i][j] = new Casella(nomeStanza, new Point(j, i));
        tempStanza.add(caselle[i][j]);
      }
    stanze.add(new Stanza(nomeStanza, tempStanza));
  }
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  private void generaTabellone() {
    caselle = new Casella[24][24];
    // Le Stanze
    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));
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

          dest.add(destinazione);
      }

      Point coord_attuali = tabellone.getPosizione(partenza);

      Casella destinazione = tabellone.getCasella(new Point(coord_attuali.x + 1, coord_attuali.y));
      if (VerificaDestinazione(partenza, destinazione))
        dest.add(destinazione);
      destinazione = tabellone.getCasella(new Point(coord_attuali.x - 1, coord_attuali.y));
      if (VerificaDestinazione(partenza, destinazione))
        dest.add(destinazione);
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  }

  public boolean verificaAccusa(Congettura accusa) {
    Giocatore giocatore = getGiocatore(accusa.getAccusante());
    Giocatore colpevole = getGiocatore(accusa.getAccusato());
    Casella destinazione;
    ArmiEnum arma = accusa.getArma();
    StanzeEnum stanza = giocatore.getStanza();
    notificaTutti(giocatore.getNome() + " accusa " + colpevole.getNome() + " di aver ucciso in " + stanza.toString() + " con l'arma " + arma.toString());

    boolean esito = false;
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

        if (daControllare.haCarta(colpevole)) {
          flag = true;
          mostrata = colpevole;
        }
      }
      Casella destinazione = tabellone.getCasellaVuotaInStanza(giocatore.getStanza());
      getGiocatore(colpevole).cambiaPosizione(destinazione);
      for (Pedina pedina : pedineArmi) {
        if (pedina.getNome().equals(ipotesi.getArma().toString())) {
          destinazione = tabellone.getCasellaVuotaInStanza(giocatore.getStanza());
          pedina.cambiaPosizione(destinazione);
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  @Before
  public void setUp() throws Exception {
    caselle = new ArrayList<Casella>();
    for (int i = 0; i < 4; i++) {
      caselle.add(new Casella(StanzeEnum.CANTINA, new Point(i, i)));
    }
    stanza = new Stanza(StanzeEnum.CANTINA, caselle);
  }
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  @Test
  public void testStanza() {
    caselle.clear();
    for (int i = 0; i < 4; i++) {
      caselle.add(new Casella(StanzeEnum.CORRIDOIO, new Point(i, i)));
    }
    stanza = new Stanza(StanzeEnum.CORRIDOIO, caselle);
    assertTrue(stanza.getNome() == StanzeEnum.CORRIDOIO);
    assertNotNull(stanza.getCaselle());
    assertNotNull(stanza.getCasellaVuotaRandom());
View Full Code Here

Examples of ingsw.proj.cluedo.componenti.Casella

  public void setUp() throws Exception {
    tabellone = new Casella[4][4];
    caselle = new ArrayList<Casella>();
    for (int i = 0; i < 4; i++)
      for (int j = 0; j < 4; j++)
        tabellone[i][i] = new Casella(StanzeEnum.BIBLIOTECA, new Point(i, j));
    stanze = new ArrayList<Stanza>();
    for (int i = 0; i < 4; i++) {
      caselle.add(new Casella(StanzeEnum.CANTINA, new Point(i, i)));
    }
    stanza = new Stanza(StanzeEnum.CANTINA, caselle);
    stanze.add(stanza);
    caselle.clear();
    for (int i = 0; i < 4; i++) {
      caselle.add(new Casella(StanzeEnum.BAGNO, new Point(i, i)));
    }
    stanza = new Stanza(StanzeEnum.BAGNO, caselle);
    stanze.add(stanza);

    tab = new Tabellone(tabellone, stanze);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.