Package org.spongepowered.asm.launch.platform

## Interface IMixinPlatformAgent

- All Known Subinterfaces:
    `IMixinPlatformServiceAgent`
  All Known Implementing Classes:
    `MixinPlatformAgentAbstract`, `MixinPlatformAgentDefault`

      public interface IMixinPlatformAgent

  Base interface for platform agents. Platform agents are environment-specific handlers which are used by the Mixin subsystem to perform platform-specific tasks required by different environments without having to litter other parts of the Mixin codebase with a bunch of environment-specific cruft.

  Platform Agents handle mixin environment tasks on a per-container basis, with each container in the environment being assigned one of each available type of agent to handle those tasks on behalf of the container.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IMixinPlatformAgent.AcceptResult` | Result type returned from `accept(org.spongepowered.asm.launch.platform.MixinPlatformManager, org.spongepowered.asm.launch.platform.container.IContainerHandle)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IMixinPlatformAgent.AcceptResult` | `accept​(MixinPlatformManager manager, IContainerHandle handle)` | Accept and bind to a container handle.
    `java.lang.String` | `getPhaseProvider()` | Get the phase provider for this agent
    `void` | `initPrimaryContainer()` | Called from `inject` in the parent tweaker but only called on the primary tweak container.
    `void` | `inject()` | Called from `inject` in the parent tweaker
    `void` | `prepare()` | Called during pre-initialisation, after all tweakers and tweak containers have been added to the environment.

- - ### Method Detail

    - #### accept

          IMixinPlatformAgent.AcceptResult accept​(MixinPlatformManager manager,
                                                  IContainerHandle handle)

      Accept and bind to a container handle. This method is called for agents hosted by `MixinContainer` and the agent should react accordingly. If the agent is not able to delegate for container handles of the supplied type, this method should return `false` to indicate that the agent should not be added for this container.
      Parameters:
        `manager` - platform manager instance
        `handle` - handle to container
      Returns:
        AcceptResult representing this agent's acceptance of the supplied container

    - #### getPhaseProvider

          java.lang.String getPhaseProvider()

      Get the phase provider for this agent

    - #### prepare

          void prepare()

      Called during pre-initialisation, after all tweakers and tweak containers have been added to the environment.

    - #### initPrimaryContainer

          void initPrimaryContainer()

      Called from `inject` in the parent tweaker but only called on the primary tweak container. This is useful if the agent needs to perform some environment-specific setup just once.

    - #### inject

          void inject()

      Called from `inject` in the parent tweaker