Class SelectableAction

    • Field Detail

      • optionId

        private final java.lang.String optionId
      • selected

        protected boolean selected
    • Constructor Detail

      • SelectableAction

        protected SelectableAction​(FreeColClient freeColClient,
                                   java.lang.String id,
                                   java.lang.String optionId)
        Creates this action.
        Parameters:
        freeColClient - The FreeColClient for the game.
        id - The object identifier.
        optionId - The identifier of a boolean client option.
    • Method Detail

      • getOption

        public final boolean getOption()
        Get the value of the underlying option.
        Returns:
        The option value.
      • setOption

        public final void setOption​(boolean value)
        Set the option value.
        Parameters:
        value - The new boolean value.
      • isSelected

        public final boolean isSelected()
        Gets whether the action is selected.
        Returns:
        True if this action is selected.
      • setSelected

        public final void setSelected​(boolean b)
        Sets whether the action is selected.
        Parameters:
        b - The new selection value.
      • shouldBeSelected

        protected boolean shouldBeSelected()
        Should this action be selected? Override this in subclasses.
        Returns:
        True of this action should be selected.