public void actionPerformed(ActionEvent ae) {
//Get panel button that fired event is part of
JButton button = (JButton)ae.getSource();
JPanel parent = (JPanel)button.getParent();
Card selectedCardType = null;
//Store what card is selected
if(button instanceof CharacterButton)
{
CharacterButton character = (CharacterButton)button;
selectedCardType = new CharacterCard(controller, character.getType());
}
else if(button instanceof WeaponButton)
{
WeaponButton weapon = (WeaponButton)button;
selectedCardType = new WeaponCard(controller, weapon.getType());
}
else if(button instanceof RoomButton)
{
RoomButton location = (RoomButton)button;
selectedCardType = new LocationCard(controller, location.getType());//location.getType();
}
System.out.println(selectedCardType.getCardType());
controller.fireDisproveCardEvent(new DisproveCardEvent(this, selectedCardType));
controller.removeModel(selectedCardType);
frame.dispose();
}