Interface PortraitProvider

  • All Known Subinterfaces:
    Handler
    All Known Implementing Classes:
    DIY

    public interface PortraitProvider
    This interface is implemented by game components that include (or may include) Portraits: images that can be configured by the user and which appear on the component's sheets.
    Since:
    2.1a13
    Author:
    Chris Jennings
    • Method Detail

      • getPortrait

        Portrait getPortrait​(int index)
        Returns a Portrait that can be used to manipulate one of the portrait images used by a component. A component may use more than one portrait. The value of index indicates which portrait is desired, and must be be between 0 and getPortraitCount()-1 (inclusive).
        Parameters:
        index - the index of the desired portrait (0 for the primary portrait)
        Returns:
        a portrait instance that controls the requested portrait
        Throws:
        java.lang.IndexOutOfBoundsException - if the portrait index is negative or greater or equal to the portrait count
      • getPortraitCount

        int getPortraitCount()
        Returns the number of portraits available from this provider. The number of portraits should remain fixed over the lifetime of a provider.
        Returns:
        the number of portraits that can be obtained with getPortrait(int) (may be 0)