Class: Stattr::CharacterSheet

Inherits:
Object
  • Object
show all
Defined in:
lib/stattr.rb

Overview

CharacterSheet of a given PlayerCharacter.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ CharacterSheet

new instance of CharacterSheet

Parameters:

  • name (String)


158
159
160
161
# File 'lib/stattr.rb', line 158

def initialize(name)
  @name = name
  @stats = StatList.new
end

Instance Attribute Details

#nameObject

The Player Character’s name



153
# File 'lib/stattr.rb', line 153

attr_accessor :stats, :name

#statsObject

Returns the value of attribute stats.



153
154
155
# File 'lib/stattr.rb', line 153

def stats
  @stats
end

Class Method Details

.roll_char(name) ⇒ Object

This is how you roll a brand new random character.

Parameters:

  • name (String)

Returns:

  • (Object)

    New Charactersheet



168
169
170
171
172
# File 'lib/stattr.rb', line 168

def self.roll_char(name)
  char = CharacterSheet.new(name)
  char.stats = StatList.new
  char
end