public void fireChanged(PlayerChangeEventType type) {
PlayerListener[] listenerList = (PlayerListener[]) listeners.getListeners(PlayerListener.class);
switch (type) {
case DRAW_CARD:
for (PlayerListener listener : listenerList) {
listener.cardDrawn(new PlayerChangedEvent(this, type));
}
break;
case STAY:
for (PlayerListener listener : listenerList) {
listener.playerStays(new PlayerChangedEvent(this, type));
}
break;
case BET:
for (PlayerListener listener : listenerList) {
listener.betMade(new PlayerChangedEvent(this, type));
}
break;
case WIN:
for (PlayerListener listener : listenerList) {
listener.playerWins(new PlayerChangedEvent(this, type));
}
break;
case LOSE:
for (PlayerListener listener : listenerList) {
listener.playerLoses(new PlayerChangedEvent(this, type));
}
break;
}
}