Sha256: 40126f97cda33e8397efdf7da655f1eb31410c8d873819a2825e6507d3c8ef4b

Contents?: true

Size: 804 Bytes

Versions: 3

Compression:

Stored size: 804 Bytes

Contents

# require 'dry-initializer'

module SpyAlleyApplication
  module Results
    class ProcessProceedingToNextState
      include Dry::Initializer.define -> do
        option :get_result_game_board_node, type: ::Types::Callable, reader: :private
        option :next_game_state, type: ::Types::Callable, reader: :private
        option :process_next_turn_options, type: ::Types::Callable, reader: :private
      end

      def call(game_board:, change_orders:, target_player_id: nil, **args)
        game_board = next_game_state.(
          game_board: game_board,
          target_player_id: target_player_id)
        process_next_turn_options.(
          game_board: game_board,
          change_orders: change_orders.push(get_result_game_board_node.(game_board: game_board)))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spy_alley_application-0.3.2 lib/spy_alley_application/results/process_proceeding_to_next_state.rb
spy_alley_application-0.3.1 lib/spy_alley_application/results/process_proceeding_to_next_state.rb
spy_alley_application-0.3.0 lib/spy_alley_application/results/process_proceeding_to_next_state.rb