Interface Transformable<C>

Type Parameters:
C - the type of composition returned by the transformation, typically an NPC or object composition
All Known Subinterfaces:
IDecorativeObject, IGameObject, IGroundObject, INPC, ITileObject, IWallObject

public interface Transformable<C>
Represents an entity that can be transformed into a different form.

Transformable entities are game objects or NPCs whose actual identity may differ from their base definition due to varbit-based transformations. This is commonly seen with NPCs that change appearance based on game state, or objects that morph into different variants.

For example, some NPCs may have a base composition but transform into a different NPC based on player progress or other game variables.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the actual ID of this entity after transformation.
    Gets the composition of this entity after transformation.
  • Method Details

    • getActualId

      int getActualId()
      Gets the actual ID of this entity after transformation.

      This returns the true ID of the entity, accounting for any varbit-based transformations. This may differ from the base ID if the entity has been transformed based on game state.

      For example, a tree that changes based on farming level would return the ID of its current visual state rather than the base tree ID.

      Returns:
      the actual ID of the entity after transformation, or the base ID if no transformation has occurred
    • getTransformedComposition

      C getTransformedComposition()
      Gets the composition of this entity after transformation.

      Returns the composition object that describes the entity's current transformed state. The composition contains detailed information about the entity such as its name, actions, and other properties.

      If the entity has a transformation chain, this follows the chain to return the final transformed composition.

      Returns:
      the transformed composition of type C, or the base composition if no transformation applies