Move readline functionality into device-independent code
This commit is contained in:
@@ -170,18 +170,19 @@ void TextGame::check_redirects() {
|
||||
}
|
||||
}
|
||||
|
||||
void TextGame::event_init()
|
||||
{
|
||||
world_.reset(new World(util::WORLD_TYPE_STANDALONE));
|
||||
world_->update_source(get_lua_source());
|
||||
world_->run_unittests();
|
||||
actor_id_ = world_->create_login_actor();
|
||||
std::cerr << "Login actor ID: " << actor_id_ << std::endl;
|
||||
get_stdio_channel()->out()->write_bytes(console_.get_prompt());
|
||||
}
|
||||
|
||||
void TextGame::event_update()
|
||||
{
|
||||
if (world_ == nullptr) {
|
||||
world_.reset(new World(util::WORLD_TYPE_STANDALONE));
|
||||
world_->update_source(get_lua_source());
|
||||
world_->run_unittests();
|
||||
actor_id_ = world_->create_login_actor();
|
||||
std::cerr << "Login actor ID: " << actor_id_ << std::endl;
|
||||
get_stdio_channel()->out()->write_bytes(console_.get_prompt());
|
||||
}
|
||||
world_->update_source(get_lua_source());
|
||||
|
||||
while (true) {
|
||||
std::string line = get_stdio_channel()->in()->readline();
|
||||
if (line == "") break;
|
||||
|
||||
Reference in New Issue
Block a user