aboutsummaryrefslogtreecommitdiff
path: root/metasol.h
diff options
context:
space:
mode:
authorTom Harley2019-01-29 12:29:37 +0000
committerTom Harley2019-01-29 12:29:37 +0000
commit160b3a382440a91fca1b4bbcde693b8b7c164aa3 (patch)
tree4baf86c19879003f43f055f2f5c85e76b2f7fefb /metasol.h
parentReorganise repo (diff)
downloadmetasol-160b3a382440a91fca1b4bbcde693b8b7c164aa3.tar.gz
metasol-160b3a382440a91fca1b4bbcde693b8b7c164aa3.zip

Add support for reading gamestates from json files

Piles of cards can now be read from .json files using the --game/-g flag, although the solver doesn’t seem to like them. Currently, cards mentioned in these files are all face-up, which means that they aren’t particularly useful for building whole games and more just test cases.

Also added command-line options parsing, including accepting randomisation seeds from the --seed/-s option.

Diffstat (limited to 'metasol.h')
-rw-r--r--metasol.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/metasol.h b/metasol.h
index e05d186..0a44442 100644
--- a/metasol.h
+++ b/metasol.h
@@ -87,6 +87,8 @@ typedef struct ms_card {
typedef std::vector<ms_card> ms_card_pile;
+ms_card ms_str_card(char *, bool);
+
typedef struct ms_game_state {
std::vector<ms_card_pile> foundations;
ms_card_pile stock;
@@ -140,7 +142,7 @@ struct thread_info {
ms_rules fetch_default_rules();
ms_settings fetch_default_settings();
-ms_game_state random_game_state(ms_rules *, ms_settings *);
+int random_game_state(long, ms_game_state *, ms_rules *);
int ms_run(ms_game_state *, ms_rules *, ms_settings *);