Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
base_position_offset.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
7#include <memory>
10#include <string>
11#include <typeinfo>
12#include <unordered_map>
14
15using namespace std;
16
17namespace jsonio {
18class NlohmannJsonUtility;
19}
20
21namespace piecepoints {
22
23// forward declare BPOPointsEKeys so BPOPointsSKeys is aware of it
24class BPOPointsEKeys;
25
29public:
30 BPOPointsSKeys(const BPOPointsSKeys &) = delete;
32
35 BasePointsSMap_t black_base_input,
36 BasePointsSMap_t red_base_offsets_input,
37 TeamPointsSMap_t black_position_input,
38 TeamPointsSMap_t red_position_offsets_input
39 );
40 BPOPointsSKeys(const string &json_file_path);
41
46
47 void ToFile(string output_path);
51
52private:
53 unique_ptr<JsonUtility<jsonio::NlohmannJsonUtility>> json_utility_;
54};
55
60public:
62 TeamBasePoints_t black_base_input,
63 TeamBasePoints_t red_base_offsets_input,
64 TeamPointsEMap_t black_position_input,
65 TeamPointsEMap_t red_position_offsets_input
66 );
67 BPOPointsEKeys(BPOPointsSKeys external_spec);
71
76};
77
78const string kICGABPOPath = utility_functs::get_data_file_abs_path("ICGA_2004_bpo.json");
79const string kICGARawPath = utility_functs::get_data_file_abs_path("ICGA_2004_raw.json");
80const string kRawSchemaPath =
81 utility_functs::get_data_file_abs_path("raw_points_schema.json");
83} // namespace piecepoints
Piece Points spec in "Base Points Offset" form with PieceType enum keys in member unordered_map objec...
TeamPointsArray_t BlackNetPoints()
GamePointsArray_t ToGamePointsArray()
TeamPointsArray_t RedNetPoints()
Piece Points spec in "Base Points Offset" form with string keys in member unordered_map objects for e...
GamePointsSMap_t ToGamePointsSmap()
unique_ptr< JsonUtility< jsonio::NlohmannJsonUtility > > json_utility_
GamePointsArray_t ToGamePointsArray()
BPOPointsSKeys & operator=(const BPOPointsSKeys &)=delete
BPOPointsSKeys(const BPOPointsSKeys &)=delete
void ToFile(string output_path)
Definition of JsonUtility CRTP interface.
Declaration and implementation of templated portions of jsonio::NlohmannJsonUtility.
Importing / exporting objects from / to json files.
Providing position-dependent values of pieces to objects in moveselection namespace.
const string kBPOSchemaPath
const string kRawSchemaPath
unordered_map< string, Points_t > BasePointsSMap_t
array< TeamPointsArray_t, 2 > GamePointsArray_t
unordered_map< string, PiecePointsArray_t > TeamPointsSMap_t
unordered_map< gameboard::PieceType, Points_t > TeamBasePoints_t
const string kICGARawPath
unordered_map< gameboard::PieceType, PiecePointsArray_t > TeamPointsEMap_t
const string kICGABPOPath
array< PiecePointsArray_t, gameboard::kNumPieceTypeVals > TeamPointsArray_t
unordered_map< string, TeamPointsSMap_t > GamePointsSMap_t
const string get_data_file_abs_path(const std::string data_file)
Defiition of miscellaneous free functions (and implementation of those that are templates).