Using Observer and Observable method update() would look as following:
@Override
public void update( Observable o, Object arg ) {
switch( (GameState) arg )
{
case NEW_GAME:
setNewGame();
break;
case CHECK:
setGameCheck( (Model) o );
break;
}
}
I want to replace it with PropertyChangeListener since Observer and Observable are deprecated. I don't know how to update depending on GameState.
Btw is there an equivalent of notifyObserver in PropertyChangeListener?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…