Skip to content

Convenience methods for one-player GUIs #20

Description

@SomeSourceCode

Description

Sometimes, GUIs are only meant to be used by one player. However, since the API is designed to work with multiple players, it can be cumbersome when you know beforehand that only one player should see the GUI at a time.

This could be accomplished by adding convenience methods, like Gui#getViewer() which would return the first viewer in the viewers list (equivalent to gui.getViewers().get(0)).

Another idea is to introduce a ViewerPolicy, such as EVERYONE (the default), FIRST_ONLY (only the first to open it), SINGLE (when a new viewer is added, the old one gets removed).

Challenges

  • Handling changes of the ViewerPolicy (e.g. switching from EVERYONE to SINGLE)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions