mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +00:00
Chess: Avoid IODevice and DeprecatedFile
This commit is contained in:
parent
715f4a8d7e
commit
0fe29a48ad
5 changed files with 30 additions and 33 deletions
|
@ -26,8 +26,8 @@ public:
|
|||
Function<void(int)> on_quit;
|
||||
|
||||
private:
|
||||
ChessEngine(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out)
|
||||
: Endpoint(in, out)
|
||||
ChessEngine(NonnullOwnPtr<Core::File> in, NonnullOwnPtr<Core::File> out)
|
||||
: Endpoint(move(in), move(out))
|
||||
{
|
||||
on_command_read_error = [](auto command, auto error) {
|
||||
outln("{}: '{}'", error, command);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
|
||||
#include "ChessEngine.h"
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
|
@ -16,7 +16,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
Core::EventLoop loop;
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto engine = TRY(ChessEngine::try_create(Core::DeprecatedFile::standard_input(), Core::DeprecatedFile::standard_output()));
|
||||
auto engine = TRY(ChessEngine::try_create(TRY(Core::File::standard_input()), TRY(Core::File::standard_output())));
|
||||
engine->on_quit = [&](auto status_code) {
|
||||
loop.quit(status_code);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue