mirror of https://github.com/dnomd343/klotski.git
Dnomd343
5 days ago
6 changed files with 81 additions and 10 deletions
@ -0,0 +1,26 @@ |
|||
/// Klotski Engine Python FFI by Dnomd343 @2024
|
|||
|
|||
#pragma once |
|||
|
|||
namespace klotski::ffi { |
|||
|
|||
// TODO: add multi-thread support
|
|||
|
|||
// TODO: add `__await__` interface support
|
|||
|
|||
class PySpeedUp { |
|||
public: |
|||
static void stage_0(); |
|||
|
|||
static void stage_1(); |
|||
|
|||
static void stage_2(); |
|||
|
|||
static bool is_stage_0(); |
|||
|
|||
static bool is_stage_1(); |
|||
|
|||
static bool is_stage_2(); |
|||
}; |
|||
|
|||
} // namespace klotski::ffi
|
@ -0,0 +1,35 @@ |
|||
#include "py_ffi/speed_up.h" |
|||
|
|||
#include <group/group.h> |
|||
#include <all_cases/all_cases.h> |
|||
|
|||
using klotski::ffi::PySpeedUp; |
|||
|
|||
using klotski::cases::AllCases; |
|||
using klotski::cases::BasicRanges; |
|||
|
|||
using klotski::group::GroupCases; |
|||
|
|||
void PySpeedUp::stage_0() { |
|||
BasicRanges::instance().build(); |
|||
} |
|||
|
|||
void PySpeedUp::stage_1() { |
|||
AllCases::instance().build(); |
|||
} |
|||
|
|||
void PySpeedUp::stage_2() { |
|||
GroupCases::build(); |
|||
} |
|||
|
|||
bool PySpeedUp::is_stage_0() { |
|||
return BasicRanges::instance().is_available(); |
|||
} |
|||
|
|||
bool PySpeedUp::is_stage_1() { |
|||
return AllCases::instance().is_available(); |
|||
} |
|||
|
|||
bool PySpeedUp::is_stage_2() { |
|||
return GroupCases::is_fast_mode(); |
|||
} |
Loading…
Reference in new issue