Browse Source

feat: add RawCode mirror functions framework

master
Dnomd343 2 years ago
parent
commit
fa6f94f9ef
  1. 2
      src/klotski_core/raw_code/CMakeLists.txt
  2. 62
      src/klotski_core/raw_code/mirror.cc
  3. 30
      src/klotski_core/raw_code/raw_code.h

2
src/klotski_core/raw_code/CMakeLists.txt

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.0)
add_library(raw_code OBJECT convert.cc raw_code.cc)
add_library(raw_code OBJECT mirror.cc convert.cc raw_code.cc)

62
src/klotski_core/raw_code/mirror.cc

@ -0,0 +1,62 @@
#include "raw_code.h"
using klotski::RawCode;
/// Static mirror functions
bool RawCode::is_vertical_mirror(RawCode &&raw_code) {
return raw_code.is_vertical_mirror();
}
bool RawCode::is_horizontal_mirror(RawCode &&raw_code) {
return raw_code.is_horizontal_mirror();
}
bool RawCode::is_vertical_mirror(const RawCode &raw_code) {
return raw_code.is_vertical_mirror();
}
bool RawCode::is_horizontal_mirror(const RawCode &raw_code) {
return raw_code.is_horizontal_mirror();
}
RawCode RawCode::to_vertical_mirror(RawCode &&raw_code) {
return raw_code.to_vertical_mirror();
}
RawCode RawCode::to_horizontal_mirror(RawCode &&raw_code) {
return raw_code.to_horizontal_mirror();
}
RawCode RawCode::to_vertical_mirror(const RawCode &raw_code) {
return raw_code.to_vertical_mirror();
}
RawCode RawCode::to_horizontal_mirror(const RawCode &raw_code) {
return raw_code.to_horizontal_mirror();
}
/// Mirror check functions
bool RawCode::is_vertical_mirror() const {
// TODO: vertical mirror check
}
bool RawCode::is_horizontal_mirror() const {
// TODO: horizontal mirror check
}
/// Mirror convert functions
RawCode RawCode::to_vertical_mirror() const {
// TODO: vertical mirror convert
}
RawCode RawCode::to_horizontal_mirror() const {
// TODO: horizontal mirror convert
}

30
src/klotski_core/raw_code/raw_code.h

@ -91,20 +91,20 @@ namespace klotski {
static RawCode from_common_code(const std::string &common_code);
/// Mirror functions
// bool is_vertical_mirror() const;
// bool is_horizontal_mirror() const;
//
// RawCode to_vertical_mirror() const;
// RawCode to_horizontal_mirror() const;
//
// static bool is_vertical_mirror(RawCode &&raw_code);
// static bool is_horizontal_mirror(RawCode &&raw_code);
// static bool is_vertical_mirror(const RawCode &raw_code);
// static bool is_horizontal_mirror(const RawCode &raw_code);
//
// static RawCode to_vertical_mirror(RawCode &&raw_code);
// static RawCode to_horizontal_mirror(RawCode &&raw_code);
// static RawCode to_vertical_mirror(const RawCode &raw_code);
// static RawCode to_horizontal_mirror(const RawCode &raw_code);
bool is_vertical_mirror() const;
bool is_horizontal_mirror() const;
RawCode to_vertical_mirror() const;
RawCode to_horizontal_mirror() const;
static bool is_vertical_mirror(RawCode &&raw_code);
static bool is_horizontal_mirror(RawCode &&raw_code);
static bool is_vertical_mirror(const RawCode &raw_code);
static bool is_horizontal_mirror(const RawCode &raw_code);
static RawCode to_vertical_mirror(RawCode &&raw_code);
static RawCode to_horizontal_mirror(RawCode &&raw_code);
static RawCode to_vertical_mirror(const RawCode &raw_code);
static RawCode to_horizontal_mirror(const RawCode &raw_code);
};
}

Loading…
Cancel
Save