// // Created by maximilian on 7/13/23. // #include #include #include #include #include #include "game_state.h" void test_game() { HanabiState<2, 2, 5, 10> state; state._stacks[0] = 2; state._stacks[1] = 3; Card r41 = {0,4,1}; state._draw_pile.push_back({r41, 1}); state._hands[0] = {y0, y1, y2, r0, r1}; state._hands[1] = {r1, r1, y1, r3, r2}; state._draw_pile_size = 1; state._card_positions[r41] = draw_pile; auto state2 = state; auto a = state.play(4); std::cout << state; state.revert(a); std::cout << state << std::endl; std::cout << state2 << std::endl; assert(state._hands == state2._hands); assert(state._draw_pile == state2._draw_pile); assert(state._card_positions == state2._card_positions); assert(state == state2); } void print_sizes() { std::cout << "size of card -> hand map: " << sizeof(HanabiState<5,3,4, 5>) << std::endl; CardSetSpecification<5> test; std::cout << sizeof(CardSetSpecification<8>::AdditionalCardsFlags) << std::endl; unsigned exp = 32; std::cout << "Pair size: " << sizeof(std::pair) << std::endl; std::cout << sizeof(boost::rational) << std::endl; std::cout << (1ul << exp) << std::endl; } int main() { test_game(); return 0; }