华容道高性能计算引擎
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
855 B

#pragma once
#include <string>
#include <cstdint>
#include <ostream>
#include "common_code.h"
class CommonCode;
class RawCode {
public:
uint64_t unwrap() const;
std::string dump_case() const;
CommonCode to_common_code() const;
static bool check(uint64_t raw_code);
// friend std::ostream& operator<<(std::ostream &out, const RawCode &self);
explicit RawCode(const CommonCode &common_code);
// TODO: check raw_code before object create
explicit RawCode(uint64_t raw_code) : code(raw_code) {}
// TODO: mirror functions
// static RawCode create(uint64_t raw_code);
// static RawCode from_common_code(const CommonCode &common_code);
// TODO: unsafe_create static function
private:
uint64_t code;
static uint64_t compact(uint64_t raw_code);
static uint64_t extract(uint64_t common_code);
};