当前位置: 首页>>代码示例>>Java>>正文


Java Pools类代码示例

本文整理汇总了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);
			}
		}
	};
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:22,代码来源:AmbientOcclusion.java

示例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);
      }
    }
  };
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:22,代码来源:AmbientOcclusion.java

示例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();
		}
	});
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:15,代码来源:WorldGraphicsPools.java

示例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;
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:16,代码来源:AreaRenderer.java

示例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();
    }
  });
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:15,代码来源:WorldGraphicsPools.java

示例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;
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:14,代码来源:AreaRenderer.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:6,代码来源:AreaRenderer.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:6,代码来源:AreaRenderer.java


注:本文中的ethanjones.cubes.core.system.Pools类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。