Package controlador

Source Code of controlador.InfoPoliciaControlador

package controlador;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import vista.InfoPoliciaVista;
import vista.JuegoVista;
import modelo.Partida;

public class InfoPoliciaControlador {

  private JuegoVista vista;
  private InfoPoliciaVista panel;
  private Partida modeloPartida;

  public InfoPoliciaControlador(Partida modeloPartida, JuegoVista vista) {

    this.vista = vista;
    this.modeloPartida = modeloPartida;

    String nombre = this.modeloPartida.verNombrePolicia();
    String rango = this.modeloPartida.verRangoPolicia().getNombre();
    int cantArrestos = this.modeloPartida.verCantDeArrestos();
    this.panel = new InfoPoliciaVista(nombre, rango, cantArrestos);

    this.panel.addVolverAPanelPartida(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        volverAPanelPartida();
      }
    });
  }

  public void volverAPanelPartida() {
    new PartidaControlador(modeloPartida, vista);
  }
 
  public void activar() {
    vista.mostrarPanel(panel);
  }


}
TOP

Related Classes of controlador.InfoPoliciaControlador

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.