module TicTacToeRZ::Languages::MessageGenerator

Attributes

language_config[R]

Public Class Methods

argument_error(method_name, argument_name, reason) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 186
def self.argument_error(method_name, argument_name, reason)
  message = get_data("application_text", "argument_error")
  message = message.gsub("[1]", method_name) if parameter_provided?(method_name)
  message = message.gsub("[2]", argument_name) if parameter_provided?(argument_name)
  message = message.gsub("[3]", reason) if parameter_provided?(reason)
  message
end
board_intro() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 111
def self.board_intro
  message = get_data("application_text", "board_intro")
end
board_square_selection(player_symbol, board_square) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 139
def self.board_square_selection(player_symbol, board_square)
  message = get_data("application_text", "board_square_selection")
  message = message.gsub("[1]", player_symbol.to_s) if parameter_provided?(player_symbol)
  message = message.gsub("[2]", board_square.to_s) if parameter_provided?(board_square)
  message
end
computer() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 228
def self.computer
  message = get_data("application_text", "computer")
end
configure_language() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 216
def self.configure_language
  message = get_data("application_text", "configure_language")
end
continue_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 92
def self.continue_prompt
  message = get_data("application_text", "continue_prompt")
end
directory() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 12
def self.directory
  directory = "config/"
end
exit_game() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 84
def self.exit_game
  message = get_data("application_text", "exit_game")
end
first_player_of_game_prompt(player_symbol_one, player_symbol_two) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 157
def self.first_player_of_game_prompt(player_symbol_one, player_symbol_two)
  message = get_data("application_text", "first_player_of_game_prompt")
  message = message.gsub("[1]", player_symbol_one.to_s) if parameter_provided?(player_symbol_one)
  message = message.gsub("[2]", player_symbol_two.to_s) if parameter_provided?(player_symbol_two)
  message
end
game_over() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 80
def self.game_over
  message = get_data("application_text", "game_over")
end
generate_file_path(file_name, language_tag) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 21
def self.generate_file_path(file_name, language_tag)
  raise Exceptions::NilReferenceError, "file_name" if file_name.nil?
  raise Exceptions::InvalidValueError, "file_name" if file_name == ""
  file_path = directory + file_name + "." + language_tag + ".yaml"
end
get_data(file_name, property) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 27
def self.get_data(file_name, property)
  data = YAMLReader.read_data(generate_file_path(file_name, get_language_config.default_language_tag), property)
end
get_language_config() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 16
def self.get_language_config
  @language_config = LanguageOptionsAdapter.new(directory) if @language_config.nil? || @language_config.stored_default_tag != @language_config.default_language_tag
  result = @language_config
end
go() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 236
def self.go
  message = get_data("application_text", "go")
end
human() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 224
def self.human
  message = get_data("application_text", "human")
end
invalid_selection_error() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 198
def self.invalid_selection_error
  message = get_data("application_text", "invalid_selection_error")
end
invalid_selection_error_for(property) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 202
def self.invalid_selection_error_for(property)
  message = get_data("application_text", "invalid_selection_error_for")
  message = message.gsub("[1]", property) if parameter_provided?(property)
  message
end
language_configuration_option() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 39
def self.language_configuration_option
  message = get_data("application_text", "language_configuration_option")
end
language_configuration_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 35
def self.language_configuration_prompt
  message = get_data("application_text", "language_configuration_prompt")
end
language_defaults_error() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 212
def self.language_defaults_error
  message = get_data("application_text", "language_defaults_error")
end
language_options() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 47
def self.language_options
  options = get_language_config.all_languages
  input_choices = get_language_config.input_choices
  count = input_choices.size
  all_options = []
  iterator = 1
  count.times do
    message = ""
    message = message + iterator.to_s + ". " + options[iterator-1]['description'] + "\n"
    all_options << message
    iterator = iterator + 1
  end
  all_options
end
language_selection_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 43
def self.language_selection_prompt
  message = get_data("application_text", "language_selection_prompt")
end
line_spacer() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 208
def self.line_spacer
  message = get_data("application_text", "line_spacer")
end
match_option_description(player1_type, player2_type) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 150
def self.match_option_description(player1_type, player2_type)
  message = get_data("application_text", "match_option_description")
  message = message.gsub("[1]", player1_type.to_s) if parameter_provided?(player1_type)
  message = message.gsub("[2]", player2_type.to_s) if parameter_provided?(player2_type)
  message
end
match_selection_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 146
def self.match_selection_prompt
  message = get_data("application_text", "match_selection_prompt")
end
next_move_prompt(player_symbol) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 133
def self.next_move_prompt(player_symbol)
  message = get_data("application_text", "next_move_prompt")
  message = message.gsub("[1]", player_symbol.to_s) if parameter_provided?(player_symbol)
  message
end
no_moves_to_undo_error() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 182
def self.no_moves_to_undo_error
  message = get_data("application_text", "no_moves_to_undo_error")
end
option_number(number) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 164
def self.option_number(number)
  message = get_data("application_text", "option_number")
  message = message.gsub("[1]", number.to_s) if parameter_provided?(number)
  message
end
parameter_provided?(parameter) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 252
def self.parameter_provided?(parameter)
  result = parameter != "" && !(parameter.nil?)
end
player() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 232
def self.player
  message = get_data("application_text", "player")
end
player_setup_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 62
def self.player_setup_prompt
  message = get_data("application_text", "player_setup_prompt")
end
player_symbol_option() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 72
def self.player_symbol_option
  message = get_data("application_text", "player_symbol_option")
end
player_symbol_prompt(player_number) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 66
def self.player_symbol_prompt(player_number)
  message = get_data("application_text", "player_symbol_prompt")
  message = message.gsub("[1]", player_number.to_s) if parameter_provided?(player_number)
  message
end
player_won(winning_symbol) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 96
def self.player_won(winning_symbol)
  message = get_data("application_text", "player_won")
  message = message.gsub("[1]", winning_symbol) if parameter_provided?(winning_symbol)
  message
end
players_intro(player1_symbol, player1_type, player2_symbol, player2_type) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 102
def self.players_intro(player1_symbol, player1_type, player2_symbol, player2_type)
  message = get_data("application_text", "players_intro")
  message = message.gsub("[1]", player1_symbol.to_s) if parameter_provided?(player1_symbol)
  message = message.gsub("[2]", player1_type.to_s) if parameter_provided?(player1_type)
  message = message.gsub("[3]", player2_symbol.to_s) if parameter_provided?(player2_symbol)
  message = message.gsub("[4]", player2_type.to_s) if parameter_provided?(player2_type)
  message
end
replay_game_prompt() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 244
def self.replay_game_prompt
  message = get_data("application_text", "replay_game_prompt")
end
start_game() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 220
def self.start_game
  message = get_data("application_text", "start_game")
end
start_new_game() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 240
def self.start_new_game
  message = get_data("application_text", "start_new_game")
end
thinking_process_for_computers_turn(player_symbol) click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 123
def self.thinking_process_for_computers_turn(player_symbol)
  message = get_data("application_text", "thinking_process_for_computers_turn")
  message = message.gsub("[1]", player_symbol.to_s) if parameter_provided?(player_symbol)
  message
end
thinking_process_incrementor() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 129
def self.thinking_process_incrementor
  message = get_data("application_text", "thinking_process_incrementor")
end
tie_game() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 88
def self.tie_game
  message = get_data("application_text", "tie_game")
end
title_of_language_options_screen() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 178
def self.title_of_language_options_screen
  message = get_data("application_text", "title_of_language_options_screen")
end
title_of_match_setup_screen() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 174
def self.title_of_match_setup_screen
  message = get_data("application_text", "title_of_match_setup_screen")
end
title_of_player_setup_screen() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 170
def self.title_of_player_setup_screen
  message = get_data("application_text", "title_of_player_setup_screen")
end
undo_completion_for_both_players() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 119
def self.undo_completion_for_both_players
  message = get_data("application_text", "undo_completion_for_both_players")
end
undo_completion_for_one_player() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 115
def self.undo_completion_for_one_player
  message = get_data("application_text", "undo_completion_for_one_player")
end
undo_last_move_option() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 76
def self.undo_last_move_option
  message = get_data("application_text", "undo_last_move_option")
end
undo_move() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 248
def self.undo_move
  message = get_data("application_text", "undo_move")
end
uniqueness_error() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 194
def self.uniqueness_error
  message = get_data("application_text", "uniqueness_error")
end
welcome() click to toggle source
# File lib/tic_tac_toe_rz/tictactoeruby.core/languages/message_generator.rb, line 31
def self.welcome
  message = get_data("application_text", "welcome")
end