Class MapObjectLoader

java.lang.Object
de.gurkenlabs.litiengine.environment.MapObjectLoader
All Implemented Interfaces:
IMapObjectLoader
Direct Known Subclasses:
CollisionBoxMapObjectLoader, CreatureMapObjectLoader, CustomMapObjectLoader, EmitterMapObjectLoader, LightSourceMapObjectLoader, MapAreaMapObjectLoader, PropMapObjectLoader, SoundSourceMapObjectLoader, SpawnpointMapObjectLoader, StaticShadowMapObjectLoader, TriggerMapObjectLoader

public abstract class MapObjectLoader
extends java.lang.Object
implements IMapObjectLoader
  • Constructor Summary

    Constructors 
    ModifierConstructorDescription
    protected MapObjectLoader​(MapObjectType mapObjectType) 
    protected MapObjectLoader​(java.lang.String mapObjectType) 
  • Method Summary

    Modifier and TypeMethodDescription
    voidafterLoad​(java.util.Collection<IEntity> entities, IMapObject mapObject)
    This method is called externally on the loader instance after the entities have been loaded.
    java.lang.StringgetMapObjectType() 
    protected booleanisMatchingType​(IMapObject mapObject) 
    static voidloadDefaultProperties​(IEntity entity, IMapObject mapObject)
    Loads engine default properties to the specified IEntity instance: width, height mapId name location tags Also, this supports predefined CustomMapObjectProperties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.gurkenlabs.litiengine.environment.IMapObjectLoader

    load
  • Constructor Details

  • Method Details

    • getMapObjectType

      public java.lang.String getMapObjectType()
      Specified by:
      getMapObjectType in interface IMapObjectLoader
    • loadDefaultProperties

      public static void loadDefaultProperties​(IEntity entity, IMapObject mapObject)
      Loads engine default properties to the specified IEntity instance:
      • width, height
      • mapId
      • name
      • location
      • tags
      Also, this supports predefined CustomMapObjectProperties. It loads the specified custom properties via reflection.
      Parameters:
      entity - The entity instance that will be initialized.
      mapObject - The mapObject that provides the static information for the new entity.
      See Also:
      TmxProperty
    • afterLoad

      public void afterLoad​(java.util.Collection<IEntity> entities, IMapObject mapObject)
      Description copied from interface: IMapObjectLoader
      This method is called externally on the loader instance after the entities have been loaded.
      Specified by:
      afterLoad in interface IMapObjectLoader
      Parameters:
      entities - The loaded entities.
      mapObject - The map object by which the entities have been loaded.
    • isMatchingType

      protected boolean isMatchingType​(IMapObject mapObject)