Class: GamesAndRpgParadise::ShakesAndFidgets::Menu

Inherits:
Object
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb

Overview

GamesAndRpgParadise::ShakesAndFidgets::Menu

Instance Method Summary collapse

Constructor Details

#initialize(run_already = true) ⇒ Menu

#

initialize

#


23
24
25
26
27
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 23

def initialize(
    run_already = true
  )
  run if run_already
end

Instance Method Details

#add_to_menu(i, description) ⇒ Object Also known as: add

#

add_to_menu

#


61
62
63
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 61

def add_to_menu(i, description)
  @menu << [i, description]
end

#build_menuObject

#

build_menu (case tag)

#


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 42

def build_menu
  reset                                                                     # Entry number:
  add 'Taverne','This is the place to seek and find new adventures.'        #   (01)
  add 'Arena','Meet other heroes and challenge them in the Arena.'          #   (02)
  add 'Stadtwache','Need some money? Work at the local guards of the town.' #   (03)
  add 'Waffenladen','Here you can buy some weapons.'                        #   (04)
  add 'Zauberladen','Here you can buy potions and magical cantrips.'        #   (05)
  add 'Stall','Need a fancy mount? Come in!'                                #   (06)
  add 'Character','Go here if you want to equip your character.'            #   (07)
  add 'Post','Send a message to another character.'                         #   (08)
  add 'Gilde','If you are looking to join a guild, come closer!'            #   (09)
  add 'Ehrenhalle','How much fame do we have?'                              #   (10)
  add 'Dungeons','Enter the Dungeon for more fame.'                         #   (11)
  add 'Optionen','Various options to set here.'                             #   (12)
end

#debugObject

#

debug

#


68
69
70
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 68

def debug
  pp @menu
end

#entriesObject

#

entries

#


75
76
77
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 75

def entries # Return our entries.
  @menu
end

#resetObject

#

reset (reset tag)

#


32
33
34
35
36
37
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 32

def reset
  # ======================================================================= #
  # === @menu
  # ======================================================================= #
  @menu = []
end

#runObject

#

run

General run method.

#


84
85
86
# File 'lib/games_and_rpg_paradise/games/shakes_and_fidgets/menu/menu.rb', line 84

def run
  build_menu
end