Last active
April 18, 2017 17:07
-
-
Save deque-blog/c35ea364d86c7b6af826b420cb8d4922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto round_gen() | |
{ | |
return int_gen(0, std::numeric_limits<int>::max()); | |
} | |
auto player_name_gen() | |
{ | |
return string_gen( | |
int_gen(1, 30), //Player name cannot be empty | |
alphanum_gen() //Restriction on the character set | |
); | |
} | |
auto coord_3d_gen(double map_size) | |
{ | |
auto coord_1d_gen = double_gen(0, map_size); | |
return tuple_gen(coord_1d_gen, coord_1d_gen, coord_1d_gen); | |
} | |
auto game_gen(int max_player, double map_size) | |
{ | |
return apply_gen( | |
to_object<Game>(), //Combine into a game | |
round_gen(), | |
sorted_map_gen(max_player, | |
player_name_gen(), | |
coord_3d_gen(map_size)) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment