I'm looking to have a base enum like this...
public enum SessionState {
WAITING(true), VOTING(true), PREPARING(false), PLAYING(false), ENDING(false);
boolean newPlayersJoin;
private SessionState(boolean newPlayersJoin){
this.newPlayersJoin = newPlayersJoin;
}
public boolean canNewPlayersJoin(){
return newPlayersJoin;
}
}
...and then another enum with the same values (WAITING, VOTING, PREPARING, PLAYING, ENDING) but with more functions. The reason I want a base enum without the extra methods is that some of the methods depend on functions that won't be included in that jar file (multi-module project)
My other enum would look something like this
public enum SessionStateCopy {
WAITING(true, ... extra values), VOTING(true, ... extra values), PREPARING(false, ... extra values), PLAYING(false, ... extra values), ENDING(false, ... extra values);
boolean newPlayersJoin;
private SessionStateCopy(boolean newPlayersJoin, ... extra values){
this.newPlayersJoin = newPlayersJoin;
}
public boolean canNewPlayersJoin(){
return newPlayersJoin;
}
... extra methods
}