def move_seeds_test_impl(boards, from_details, to_board, to_details): game = GameState(game_params=DEFAULT_GAME_PARAMETERS, game_id=sentinel.game_id, boards=boards, board_width=10, board_height=10, hives=[sentinel.hives] * boards, flowers=[sentinel.flowers] * boards, game_length=sentinel.game_length) game.boards[0].inflight[sentinel.seed_1] = from_details game.move_volants() assert [ i for i, board in enumerate(game.boards) if sentinel.seed_1 in board.inflight ] == [to_board] assert game.boards[to_board].inflight == {sentinel.seed_1: to_details}
def move_bees_test_impl(bee_type, boards, from_details, to_board, to_details): game = GameState(game_params=DEFAULT_GAME_PARAMETERS, game_id=sentinel.game_id, boards=boards, board_width=10, board_height=10, hives=[sentinel.hives] * boards, flowers=[sentinel.flowers] * boards, game_length=sentinel.game_length) x, y, h, e, n = from_details xt, yt, ht, et, nt = to_details game.boards[0].inflight[sentinel.bee_1] = bee_type( x, y, h, e, DEFAULT_GAME_PARAMETERS, n) game.move_volants() assert [ i for i, board in enumerate(game.boards) if sentinel.bee_1 in board.inflight ] == [to_board] assert game.boards[to_board].inflight == { sentinel.bee_1: bee_type(xt, yt, ht, et, DEFAULT_GAME_PARAMETERS, nt) }