Added a display name to Actors

This commit is contained in:
Matthew Miller
2018-12-18 17:36:53 +10:00
committed by IronApollo
parent bc3562eb57
commit 54142c8669
4 changed files with 24 additions and 1 deletions

View File

@ -38,6 +38,15 @@ public interface Actor extends Identifiable, SessionOwner, Subject {
*/
String getName();
/**
* Gets the display name of the actor. This can be a nickname, and is not guaranteed to be unique.
*
* @return The display name
*/
default String getDisplayName() {
return getName();
}
/**
* Print a message.
*

View File

@ -99,6 +99,11 @@ public class PlayerProxy extends AbstractPlayerActor {
return basePlayer.getName();
}
@Override
public String getDisplayName() {
return basePlayer.getDisplayName();
}
@Override
public BaseEntity getState() {
throw new UnsupportedOperationException("Can't withPropertyId() on a player");