本文整理汇总了Java中ethanjones.cubes.core.system.Pools类的典型用法代码示例。如果您正苦于以下问题:Java Pools类的具体用法?Java Pools怎么用?Java Pools使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Pools类属于ethanjones.cubes.core.system包,在下文中一共展示了Pools类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSetting
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static Setting getSetting() {
String[] strings = new String[Strength.values().length + 1];
strings[0] = "disabled";
for (int i = 1; i < strings.length; i++) {
strings[i] = Strength.values()[i - 1].name();
}
return new DropDownSetting(strings) {
{
selected = "disabled";
}
@Override
public void onChange() {
if (Pools.poolExists(AreaMesh.class)) {
Log.debug("Clearing AreaMesh pool on AO setting change");
WorldGraphicsPools.free();
Pools.clearPool(AreaMesh.class);
}
}
};
}
示例2: getSetting
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static Setting getSetting() {
String[] strings = new String[Strength.values().length + 1];
strings[0] = "disabled";
for (int i = 1; i < strings.length; i++) {
strings[i] = Strength.values()[i - 1].name();
}
return new DropDownSetting(strings) {
{
selected = "disabled";
}
@Override
public void onChange() {
if (Pools.poolExists(AreaMesh.class)) {
Log.debug("Clearing AreaMesh pool on AO setting change");
WorldGraphicsPools.free();
Pools.clearPool(AreaMesh.class);
}
}
};
}
示例3: init
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static void init() {
Pools.registerType(AreaRenderer.class, new Pool<AreaRenderer>() {
@Override
protected AreaRenderer newObject() {
return new AreaRenderer();
}
});
Pools.registerType(AreaMesh.class, new DisposablePool<AreaMesh>() {
@Override
protected AreaMesh newObject() {
return new AreaMesh();
}
});
}
示例4: free
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static void free(AreaRenderer[] areaRenderer) {
if (areaRenderer == null)
return;
boolean isClient = Side.isMainThread(Side.Client);
for (int i = 0; i < areaRenderer.length; i++) {
if (areaRenderer[i] == null)
continue;
if (isClient) {
Pools.free(AreaRenderer.class, areaRenderer[i]);
} else {
WorldGraphicsPools.toFree.add(areaRenderer[i]);
}
areaRenderer[i] = null;
}
}
示例5: init
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static void init() {
Pools.registerType(AreaRenderer.class, new Pool<AreaRenderer>() {
@Override
protected AreaRenderer newObject() {
return new AreaRenderer();
}
});
Pools.registerType(AreaMesh.class, new DisposablePool<AreaMesh>() {
@Override
protected AreaMesh newObject() {
return new AreaMesh();
}
});
}
示例6: free
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
public static void free(AreaRenderer[] areaRenderer) {
if (areaRenderer == null) return;
boolean isClient = Side.isMainThread(Side.Client);
for (int i = 0; i < areaRenderer.length; i++) {
if (areaRenderer[i] == null) continue;
if (isClient) {
Pools.free(AreaRenderer.class, areaRenderer[i]);
} else {
WorldGraphicsPools.toFree.add(areaRenderer[i]);
}
areaRenderer[i] = null;
}
}
示例7: save
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
private void save(int vertexCount) {
AreaMesh areaMesh = Pools.obtain(AreaMesh.class);
areaMesh.saveVertices(vertexCount);
meshs.add(areaMesh);
}
示例8: save
import ethanjones.cubes.core.system.Pools; //导入依赖的package包/类
private void save(int vertexCount) {
AreaMesh areaMesh = Pools.obtain(AreaMesh.class);
areaMesh.saveVertices(vertexCount);
meshs.add(areaMesh);
}