Class: GamesAndRpgParadise::DnD::Combat

Inherits:
Object
  • Object
show all
Includes:
Base::Extensions, Base::Extensions::CommandlineArguments
Defined in:
lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb

Overview

GamesAndRpgParadise::DnD::Combat

Constant Summary

Constants included from CommonExtensions

CommonExtensions::CONTROL_C_CODE, CommonExtensions::N

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base::Extensions::CommandlineArguments

#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments

Methods included from CommonExtensions

#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #log_dir?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap, #write_what_into

Constructor Details

#initialize(commandline_arguments = nil, run_already = true) ⇒ Combat

#

initialize

#


46
47
48
49
50
51
52
53
54
55
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 46

def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

GamesAndRpgParadise::DnD::Combat[]

#


97
98
99
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 97

def self.[](i = ARGV)
  new(i)
end

Instance Method Details

#combat_round?Boolean

#

combat_round?

#

Returns:

  • (Boolean)


83
84
85
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 83

def combat_round?
  @internal_hash[:combat_round]
end

#increment_the_combat_roundObject

#

increment_the_combat_round

#


76
77
78
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 76

def increment_the_combat_round
  @internal_hash[:combat_round] += 1
end

#resetObject

#

reset (reset tag)

#


60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 60

def reset
  super() if respond_to?(:super)
  infer_the_namespace
  # ======================================================================= #
  # === @internal_hash
  # ======================================================================= #
  @internal_hash = {}
  # ======================================================================= #
  # === :combat_round
  # ======================================================================= #
  @internal_hash[:combat_round] = 0 # We will increment this lateron.
end

#runObject

#

run (run tag)

#


90
91
92
# File 'lib/games_and_rpg_paradise/rpg/dnd/combat/combat.rb', line 90

def run
pp self # For debugging. Should be removed / replaced.
end