Skip to content

Attributes

Rayzr edited this page May 21, 2018 · 2 revisions

Attributes

An arbitrary piece of data of any type that can be attached to minigames, phases, arenas, players, etc.

Attributes are stored in a String key map, which is accessible on any class which implements the Attributable interface (name prone to change). Attribute types must support automatic serialization and deserialization.

Example use cases of an attribute would be a kill counter for a phase, or a high-score attached to the player's data.

Arena Attributes

Arena attributes have the unique feature of automatically generating commands that attach to them. For example, a Spleef game would have an attribute depicting a cuboid region for the death zone. A command would automatically be generated for setting the death zone of an arena.

Generic arena commands are constructed with two parameters:

  1. The Attributable with which they are associated.
  2. The key of the attribute which they are modifying.
Clone this wiki locally