mirror of
https://github.com/kirirururu/screepsxx.git
synced 2026-06-14 17:30:42 +00:00
20 lines
362 B
C++
20 lines
362 B
C++
#include <Screeps/Context.hpp>
|
|
#include <Screeps/Creep.hpp>
|
|
|
|
#include <emscripten.h>
|
|
#include <emscripten/bind.h>
|
|
|
|
EMSCRIPTEN_KEEPALIVE
|
|
extern "C" void loop()
|
|
{
|
|
Screeps::Context::update();
|
|
|
|
auto creeps = Screeps::Game.creeps();
|
|
for (auto& creep : creeps)
|
|
creep.second.say("screepsxx");
|
|
}
|
|
|
|
EMSCRIPTEN_BINDINGS(loop)
|
|
{
|
|
emscripten::function("loop", &loop);
|
|
}
|