Interface IMapObjectLoader

All Known Implementing Classes:
CollisionBoxMapObjectLoader, CreatureMapObjectLoader, CustomMapObjectLoader, EmitterMapObjectLoader, LightSourceMapObjectLoader, MapAreaMapObjectLoader, MapObjectLoader, PropMapObjectLoader, SoundSourceMapObjectLoader, SpawnpointMapObjectLoader, StaticShadowMapObjectLoader, TriggerMapObjectLoader

public interface IMapObjectLoader
This interface provides methods that are required for loading an IEntity from an IMapObject. It separates the actual entity implementation from the loading process and provide a place to implement all the logic to load attributes and initialize logic based on static information from the IMap.

The engine provides default implementations for all predefined Entity types (e.g. Prop or Creature). You can inherit/call the abstract MapObjectLoader implementation to make use of predefined loading logic.
See Also:
Environment.registerMapObjectLoader(IMapObjectLoader), MapObjectLoader.loadDefaultProperties(IEntity, IMapObject)
  • Method Details

    • getMapObjectType

      java.lang.String getMapObjectType()
    • load

      java.util.Collection<IEntity> load​(Environment environment, IMapObject mapObject)
    • afterLoad

      void afterLoad​(java.util.Collection<IEntity> entities, IMapObject mapObject)
      This method is called externally on the loader instance after the entities have been loaded.
      entities - The loaded entities.
      mapObject - The map object by which the entities have been loaded.