Interface IMagic


  • public interface IMagic
    Represents a magic element that can have interactions with other magics. Each magic has unique properties such as an ID, name, color, and display name, and can hold interaction values with other magics.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getColor()
      Gets the color of this magic.
      java.lang.String getDisplayName()
      Gets the display name of the magic.
      int getId()
      Gets the unique identifier of this magic.
      float getInteraction​(int magicID, float value)
      Retrieves the interaction value for a specific other magic.
      java.lang.String getName()
      Gets the internal name of the magic.
      boolean hasInteraction​(int magicID)
      Checks if this magic has an interaction value set for another magic.
      void save()
      Saves the current state of the magic.
      void setColor​(int c)
      Sets the color for this magic.
      void setDisplayName​(java.lang.String displayName)
      Sets the display name of the magic.
      void setInteraction​(int magicID, float value)
      Sets an interaction value for a specific other magic.
      void setName​(java.lang.String name)
      Sets the internal name of the magic.
    • Method Detail

      • getId

        int getId()
        Gets the unique identifier of this magic.
        Returns:
        the magic ID
      • getName

        java.lang.String getName()
        Gets the internal name of the magic.
        Returns:
        the name of the magic
      • setName

        void setName​(java.lang.String name)
        Sets the internal name of the magic.
        Parameters:
        name - the new name of the magic
      • setColor

        void setColor​(int c)
        Sets the color for this magic.
        Parameters:
        c - the color represented as an integer (typically in hexadecimal)
      • getColor

        int getColor()
        Gets the color of this magic.
        Returns:
        the color as an integer
      • getDisplayName

        java.lang.String getDisplayName()
        Gets the display name of the magic.
        Returns:
        the display name of the magic
      • setDisplayName

        void setDisplayName​(java.lang.String displayName)
        Sets the display name of the magic.
        Parameters:
        displayName - the new display name
      • save

        void save()
        Saves the current state of the magic. Typically persists changes to a controller or storage system.
      • hasInteraction

        boolean hasInteraction​(int magicID)
        Checks if this magic has an interaction value set for another magic.
        Parameters:
        magicID - the unique identifier of the other magic
        Returns:
        true if an interaction is present, false otherwise
      • setInteraction

        void setInteraction​(int magicID,
                            float value)
        Sets an interaction value for a specific other magic.
        Parameters:
        magicID - the unique identifier of the other magic
        value - the interaction value (usually a percentage or multiplier)
      • getInteraction

        float getInteraction​(int magicID,
                             float value)
        Retrieves the interaction value for a specific other magic.
        Parameters:
        magicID - the unique identifier of the other magic
        value - the default value to return if no interaction is found
        Returns:
        the interaction value if present; otherwise, the default value