use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class HashHelperTest method setUp.
@Before
public void setUp() {
context = new SystemContext();
hasher = new HashHelper(new SystemContext());
executor = context.vertx().createSharedWorkerExecutor("worker_pool_name", 8);
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class LauncherIT method setUp.
@Before
public void setUp() {
core = new SystemContext();
Delay.initialize(core);
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class GameContext method main.
public static void main(String[] args) throws InterruptedException {
RealmSettings settings = new RealmSettings().setName("testing");
RealmContext.create(new SystemContext(), settings).setHandler(create -> {
RealmContext realm = create.result();
InstanceContext ins = new InstanceContext(realm, new InstanceSettings());
GameContext game = new GameContext(ins);
/* game.ticker(ticker -> {
System.out.println("DING");
}, 50);*/
Creature cl = new ListeningPerson();
game.add(cl);
// cast the poison spell on himself.
cl.getSpells().getLearned().add("poisoner");
for (int i = 0; i < 2; i++) {
boolean casted = game.spells.cast(cl, new SpellTarget().setCreature(cl), "poisoner");
System.out.println("casted = " + casted);
}
});
// todo: add more hooks to SpellEngine afflictions. onDamage etc.
// todo: test cases
// todo: script npcs: onDeath, onAI etc.
// - afflict, duration, cancel etc.
// - cast spell: cooldown, charges etc.
/*for (int i = 0; i < 200; i++) {
game.add(new TalkingPerson());
game.add(new TalkingPerson());
game.add(new ListeningPerson());
}*/
/*game.ticker(ticker -> {
System.out.println(ListeningPerson.called);
}, TICK_INTERVAL_MS);*/
// game.ticker((ticker) -> System.out.println(ticker.delta()), 1);
// System.exit(0);
/* game.addCreature(new TalkingPerson(game));
game.addCreature(new TalkingPerson(game));
game.addCreature(new ListeningPerson(game));*/
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class ServiceLogHandlerTest method setUp.
@Before
public void setUp(TestContext test) {
Async async = test.async();
context = new LogContext(new SystemContext(), future);
future.setHandler(done -> {
context.storage().clear(clear -> {
async.complete();
});
handler = new ServiceLogHandler(context);
});
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class BenchmarkTests method setUp.
@Before
public void setUp() {
context = new SystemContext();
groups.add(new MockGroupBuilder(context, "mock-group-1", ITERATIONS));
groups.add(new MockGroupBuilder(context, "mock-group-2", ITERATIONS));
executor = new BenchmarkExecutor(context);
}
Aggregations