當前位置: 首頁>>代碼示例>>Java>>正文


Java Constants類代碼示例

本文整理匯總了Java中com.badlogic.ashley.benchmark.Constants的典型用法代碼示例。如果您正苦於以下問題:Java Constants類的具體用法?Java Constants怎麽用?Java Constants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Constants類屬於com.badlogic.ashley.benchmark包,在下文中一共展示了Constants類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepare

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BeforeClass
public static void prepare () {
	worldSmall = prepareWorld(Constants.ENTITIES_SMALL_TEST);
	worldMedium = prepareWorld(Constants.ENTITIES_MEDIUM_TEST);
	worldBig = prepareWorld(Constants.ENTITIES_BIG_TEST);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:7,代碼來源:ArtemisBenchmark.java

示例2: worldSmallTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void worldSmallTest () {
	runWorldTest(worldSmall);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:ArtemisBenchmark.java

示例3: worldMediumTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void worldMediumTest () {
	runWorldTest(worldMedium);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:ArtemisBenchmark.java

示例4: worldBigTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void worldBigTest () {
	runWorldTest(worldBig);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:ArtemisBenchmark.java

示例5: runWorldTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
private void runWorldTest (World world) {
	for (int i = 0; i < Constants.FRAMES; ++i) {
		world.setDelta(Constants.DELTA_TIME);
		world.process();
	}
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:7,代碼來源:ArtemisBenchmark.java

示例6: prepareWorld

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
private static World prepareWorld (int numEntities) {
	World world = new World();

	world.setSystem(new MovementSystem());
	world.setSystem(new StateSystem());
	world.setSystem(new CollisionSystem());
	world.setSystem(new RemovalSystem());

	world.initialize();

	for (int i = 0; i < numEntities; ++i) {
		Entity entity = world.createEntity();

		if (Constants.shouldHaveComponent(ComponentType.POSITION, i)) {
			PositionComponent pos = new PositionComponent();
			pos.pos.x = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			pos.pos.y = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			entity.addComponent(pos);
		}

		if (Constants.shouldHaveComponent(ComponentType.MOVEMENT, i)) {
			MovementComponent mov = new MovementComponent();
			mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.velocity.y = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.accel.x = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
			mov.accel.y = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);

			entity.addComponent(mov);
		}

		if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
			RadiusComponent rad = new RadiusComponent();
			rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
			entity.addComponent(rad);
		}

		if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
			entity.addComponent(new StateComponent());
		}

		world.addEntity(entity);
	}

	return world;
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:46,代碼來源:ArtemisBenchmark.java

示例7: prepare

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BeforeClass
public static void prepare () {
	engineSmall = prepareEngine(Constants.ENTITIES_SMALL_TEST);
	engineMedium = prepareEngine(Constants.ENTITIES_MEDIUM_TEST);
	engineBig = prepareEngine(Constants.ENTITIES_BIG_TEST);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:7,代碼來源:AshleyBenchmark.java

示例8: ashleySmallTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void ashleySmallTest () {
	runEngineTest(engineSmall);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:AshleyBenchmark.java

示例9: ashleyMediumTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void ashleyMediumTest () {
	runEngineTest(engineMedium);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:AshleyBenchmark.java

示例10: ashleyBigTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void ashleyBigTest () {
	runEngineTest(engineBig);
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:AshleyBenchmark.java

示例11: runEngineTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
private void runEngineTest (Engine engine) {
	for (int i = 0; i < Constants.FRAMES; ++i) {
		engine.update(Constants.DELTA_TIME);
	}
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:6,代碼來源:AshleyBenchmark.java

示例12: prepareEngine

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
private static Engine prepareEngine (int numEntities) {
	Engine engine = new Engine();

	engine.addSystem(new MovementSystem());
	engine.addSystem(new StateSystem());
	engine.addSystem(new CollisionSystem());
	engine.addSystem(new RemovalSystem());

	for (int i = 0; i < numEntities; ++i) {
		Entity entity = new Entity();

		if (Constants.shouldHaveComponent(ComponentType.POSITION, i)) {
			PositionComponent pos = new PositionComponent();
			pos.pos.x = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			pos.pos.y = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			entity.add(pos);
		}

		if (Constants.shouldHaveComponent(ComponentType.MOVEMENT, i)) {
			MovementComponent mov = new MovementComponent();
			mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.velocity.y = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.accel.x = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
			mov.accel.y = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);

			entity.add(mov);
		}

		if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
			RadiusComponent rad = new RadiusComponent();
			rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
			entity.add(rad);
		}

		if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
			entity.add(new StateComponent());
		}

		engine.addEntity(entity);
	}

	return engine;
}
 
開發者ID:DevelopersGuild,項目名稱:Planetbase,代碼行數:44,代碼來源:AshleyBenchmark.java

示例13: prepare

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BeforeClass
public static void prepare() {
    worldSmall = prepareWorld(Constants.ENTITIES_SMALL_TEST);
    worldMedium = prepareWorld(Constants.ENTITIES_MEDIUM_TEST);
    worldBig = prepareWorld(Constants.ENTITIES_BIG_TEST);
}
 
開發者ID:grum,項目名稱:Ashley,代碼行數:7,代碼來源:ArtemisBenchmark.java

示例14: worldSmallTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void worldSmallTest() {
    runWorldTest(worldSmall);
}
 
開發者ID:grum,項目名稱:Ashley,代碼行數:6,代碼來源:ArtemisBenchmark.java

示例15: worldMediumTest

import com.badlogic.ashley.benchmark.Constants; //導入依賴的package包/類
@BenchmarkOptions(benchmarkRounds = Constants.BENCHMARK_ROUNDS, warmupRounds = Constants.WARMUP_ROUNDS)
@Test
public void worldMediumTest() {
    runWorldTest(worldMedium);
}
 
開發者ID:grum,項目名稱:Ashley,代碼行數:6,代碼來源:ArtemisBenchmark.java


注:本文中的com.badlogic.ashley.benchmark.Constants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。