gpt4 book ai didi

com.artemis.WorldConfigurationBuilder类的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 23:53:05 25 4
gpt4 key购买 nike

本文整理了Java中com.artemis.WorldConfigurationBuilder类的一些代码示例,展示了WorldConfigurationBuilder类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldConfigurationBuilder类的具体详情如下:
包路径:com.artemis.WorldConfigurationBuilder
类名称:WorldConfigurationBuilder

WorldConfigurationBuilder介绍

[英]World builder.

Allows convenient var-arg addition of systems, managers. Supports plugins.
[中]世界建设者。
允许方便的var arg添加系统、管理器。支持插件。

代码示例

代码示例来源:origin: junkdog/artemis-odb

public void setup(WorldConfigurationBuilder b) {
    b.dependsOn(WorldConfigurationBuilder.Priority.HIGH, SuperMapper.class);
  }
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-plugin-logging-api

@Override
public void setup(WorldConfigurationBuilder b) {
  b.register(new FieldResolver() {
    @Override
    public void initialize(World world) {
    }
    @Override
    public Object resolve(Object target, Class<?> fieldType, Field field) {
      if (fieldType.equals(Log.class)) {
        return createLogger(target);
      }
      return null;
    }
  });
}

代码示例来源:origin: junkdog/artemis-odb

/**
 * Add plugins to world.
 * <p/>
 * Upon build plugins will be called to register dependencies.
 * <p/>
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param plugins Plugins to add.
 * @return this
 * @throws WorldConfigurationException if type is added more than once.
 */
public WorldConfigurationBuilder with(ArtemisPlugin... plugins) {
  addPlugins(plugins);
  return this;
}

代码示例来源:origin: DaanVanYperen/libgdx-artemis-quickstart

protected World createWorld() {
  return new World(new WorldConfigurationBuilder()
      // keeps components available until all listeners have been called.
      // Use this if your systems need to access components to clean up after removal.
      .alwaysDelayComponentRemoval(true)
      // Describes dependencies on plugins. You can find more example plugins commented out in build.gradle.
      .dependsOn(
          //EntityLinkManager.class,
          //OperationsPlugin.class,
          ProfilerPlugin.class,
          FluidEntityPlugin.class)
      .with(
          // put your own systems here! With the default InvocationStrategy they are called in order each frame.
          new ExampleSystem()
      ).build());
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-plugin-profiler

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.register(new ProfilerInvocationStrategy());
    b.dependsOn(WorldConfigurationBuilder.Priority.LOWEST + 1000,ProfilerSystem.class);
  }
}

代码示例来源:origin: yichen0831/Bomberman_libGdx

b2dRenderer = new Box2DDebugRenderer();
WorldConfiguration worldConfiguration = new WorldConfigurationBuilder()
    .with(
        new PlayerSystem(),
        new BombSystem(),
        new ParticleSystem(batch)
    .build();

代码示例来源:origin: junkdog/artemis-odb

/**
 * Register active system(s).
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param systems systems to add, order is preserved.
 * @return this
 * @throws WorldConfigurationException if registering the same class twice.
 */
public WorldConfigurationBuilder with(BaseSystem... systems) {
  addSystems(Priority.NORMAL, systems);
  return this;
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-core

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.register(new ExtendedComponentMapperFieldResolver());
    b.dependsOn(ExtendedComponentMapperManager.class);
  }
}

代码示例来源:origin: junkdog/artemis-odb

/**
 * Register active system(s).
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param systems  systems to add, order is preserved.
 * @param priority priority of added systems, higher priority are added before lower priority.
 * @return this
 * @throws WorldConfigurationException if registering the same class twice.
 */
public WorldConfigurationBuilder with(int priority, BaseSystem... systems) {
  addSystems(priority, systems);
  return this;
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.register(new ProfilerInvocationStrategy());
    b.dependsOn(WorldConfigurationBuilder.Priority.LOWEST + 1000,ProfilerSystem.class);
  }
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-plugin-operations

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.dependsOn(ExtendedComponentMapperPlugin.class);
    b.dependsOn(WorldConfigurationBuilder.Priority.OPERATIONS, SchedulerSystem.class);
  }
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

@Override
public void setup(WorldConfigurationBuilder b) {
  b.register(new FieldResolver() {
    @Override
    public void initialize(World world) {
    }
    @Override
    public Object resolve(Object target, Class<?> fieldType, Field field) {
      if (fieldType.equals(Log.class)) {
        return createLogger(target);
      }
      return null;
    }
  });
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

/**
 * Register active system(s).
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param systems systems to add, order is preserved.
 * @return this
 * @throws WorldConfigurationException if registering the same class twice.
 */
public WorldConfigurationBuilder with(BaseSystem... systems) {
  addSystems(Priority.NORMAL, systems);
  return this;
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

/**
 * Add plugins to world.
 * <p/>
 * Upon build plugins will be called to register dependencies.
 * <p/>
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param plugins Plugins to add.
 * @return this
 * @throws WorldConfigurationException if type is added more than once.
 */
public WorldConfigurationBuilder with(ArtemisPlugin... plugins) {
  addPlugins(plugins);
  return this;
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.register(new ExtendedComponentMapperFieldResolver());
    b.dependsOn(ExtendedComponentMapperManager.class);
  }
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

@Override
  public void setup(WorldConfigurationBuilder b) {
    b.dependsOn(ExtendedComponentMapperPlugin.class);
    b.dependsOn(WorldConfigurationBuilder.Priority.OPERATIONS, SchedulerSystem.class);
  }
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

/**
 * Register active system(s).
 * Only one instance of each class is allowed.
 * Use {@link #dependsOn} from within plugins whenever possible.
 *
 * @param systems  systems to add, order is preserved.
 * @param priority priority of added systems, higher priority are added before lower priority.
 * @return this
 * @throws WorldConfigurationException if registering the same class twice.
 */
public WorldConfigurationBuilder with(int priority, BaseSystem... systems) {
  addSystems(priority, systems);
  return this;
}

代码示例来源:origin: junkdog/artemis-odb

/**
 * Specify dependency on systems/plugins.
 * <p/>
 * Managers track priority separate from system priority, and are always added before systems.
 * <p>
 * Artemis will consider abstract plugin dependencies fulfilled when a concrete subclass has been registered
 * beforehand.
 *
 * @param types required systems.
 * @return this
 */
public final WorldConfigurationBuilder dependsOn(Class... types) {
  return dependsOn(Priority.NORMAL, types);
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

/**
 * Specify dependency on systems/plugins.
 * <p/>
 * Managers track priority separate from system priority, and are always added before systems.
 * <p>
 * Artemis will consider abstract plugin dependencies fulfilled when a concrete subclass has been registered
 * beforehand.
 *
 * @param types required systems.
 * @return this
 */
public final WorldConfigurationBuilder dependsOn(Class... types) {
  return dependsOn(Priority.NORMAL, types);
}

代码示例来源:origin: DaanVanYperen/libgdx-artemis-quickstart

public void setup(WorldConfigurationBuilder b) {
    b.dependsOn(WorldConfigurationBuilder.Priority.HIGH, SuperMapper.class);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com