Class: GamesAndRpgParadise::Sarlamar::Player
- Defined in:
- lib/games_and_rpg_paradise/games/sarlamar/player.rb
Overview
GamesAndRpgParadise::Sarlamar::Player
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
Constants included from Base::Extensions::Colours
Base::Extensions::Colours::ARRAY_AVAILABLE_KONSOLE_COLOURS
Constants included from CommonExtensions
CommonExtensions::CONTROL_C_CODE, CommonExtensions::N
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.[](i = ARGV) ⇒ Object
# === GamesAndRpgParadise::Sarlamar::Player[] ========================================================================= #.
Instance Method Summary collapse
-
#create_hero ⇒ Object
# === create_hero.
-
#has_hero? ⇒ Boolean
# === has_hero?.
-
#hero? ⇒ Boolean
(also: #hero)
# === hero? ====================================================================== #.
-
#initialize(name = 'testplayer') ⇒ Player
constructor
# === initialize ====================================================================== #.
-
#reset ⇒ Object
# === reset ====================================================================== #.
Methods included from Base::Extensions::Colours
ecomment, #efancy, #eparse, #forestgreen, #gold, #grey, #lightblue, #mediumseagreen, #mediumslateblue, #peru, #rev, sdir, sfancy, #sfile, simp, #teal, #yellow
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(name = 'testplayer') ⇒ Player
#
initialize
#
32 33 34 35 36 37 38 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 32 def initialize(name = 'testplayer') if name.is_a? Array name = name.join(' ').strip end @name = 'Zordan' reset end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 27 def name @name end |
Class Method Details
.[](i = ARGV) ⇒ Object
#
GamesAndRpgParadise::Sarlamar::Player[]
#
80 81 82 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 80 def self.[](i = ARGV) new(i) end |
Instance Method Details
#create_hero ⇒ Object
#
create_hero
Use this method to create a new hero.
#
52 53 54 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 52 def create_hero @hero = DsaHero.new end |
#has_hero? ⇒ Boolean
#
has_hero?
this method will “decide” whether a player has a hero or not.
#
68 69 70 71 72 73 74 75 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 68 def has_hero? if @hero.nil? return_value = false else return_value = true end return return_value end |
#hero? ⇒ Boolean Also known as: hero
#
hero?
#
59 60 61 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 59 def hero? @hero end |
#reset ⇒ Object
#
reset
#
43 44 45 |
# File 'lib/games_and_rpg_paradise/games/sarlamar/player.rb', line 43 def reset @hero = nil end |