use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class PatchHandlerTest method startUp.
@BeforeClass
public static void startUp() {
system = new SystemContext();
PatchContext context = new PatchContext(system) {
@Override
public String directory() {
return testDirectory();
}
@Override
public FileSystem fileSystem() {
return new FileSystemMock(vertx);
}
};
handler = new PatchHandler(context);
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class RouterHandlerTest method setUp.
@Before
public void setUp() {
core = new SystemContext();
system().setClusterTimeout(500);
handler = new RouterHandler(new RouterContext(core) {
@Override
public RouterSettings service() {
return new RouterSettings().addExternal(NODE_WEBSERVER, ".*");
}
});
handler.init(core);
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class SpellEngine method main.
public static void main(String[] args) {
RealmSettings settings = new RealmSettings().setName("testing");
RealmContext.create(new SystemContext(), settings).setHandler(create -> {
RealmContext rc = create.result();
InstanceContext ins = new InstanceContext(rc, new InstanceSettings());
GameContext game = new GameContext(ins);
SpellEngine engine = new SpellEngine(game);
JsonObject affConfig = ConfigurationFactory.readObject("/afflictiontest.yaml");
Affliction affliction = Serializer.unpack(affConfig, Affliction.class);
Creature target = new ListeningPerson();
Creature source = new ListeningPerson();
game.add(target);
game.add(source);
for (int i = 0; i < 500; i++) {
engine.afflict(source, target, affliction.getName());
}
});
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class SimpleEntity method main.
public static void main(String[] args) {
new StorageLoader<PlayerCreature>().diskIndex(new SystemContext()).withValue(PlayerCreature.class).build(load -> {
AsyncStorage<PlayerCreature> storage = load.result();
PlayerCreature c = new PlayerCreature();
storage.put(c, done -> {
c.setName("newName");
storage.update(c, updated -> {
storage.get(c.id, got -> {
System.out.println(got.result().name);
});
});
});
});
}
use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.
the class CachedFileStoreTest method setUp.
@Before
public void setUp() {
Configurations.system().setCachedFilePoll(20);
CachedFileStore.reset();
context = new SystemContext();
}
Aggregations