Class: BloodChalice::Chalice
- Inherits:
-
Object
- Object
- BloodChalice::Chalice
- Includes:
- Movable, TileValues
- Defined in:
- lib/bloodchalice/chalice.rb
Constant Summary
Constants included from Movable
Instance Attribute Summary collapse
-
#blood ⇒ Object
Returns the value of attribute blood.
-
#life ⇒ Object
Returns the value of attribute life.
-
#map ⇒ Object
Returns the value of attribute map.
-
#position ⇒ Object
Returns the value of attribute position.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Chalice
constructor
A new instance of Chalice.
- #to_s ⇒ Object
Methods included from TileValues
#chalice?, #empty?, #knight?, #peasant?, #player?, #wall?, #zombie?
Methods included from Movable
#hit, #move, #move!, #moves?, #reactions, #reset_moves
Constructor Details
#initialize(options = {}) ⇒ Chalice
Returns a new instance of Chalice.
8 9 10 11 12 13 14 |
# File 'lib/bloodchalice/chalice.rb', line 8 def initialize( = {}) @position = [:position] @map = [:map] @life = 400 @blood = 0 @value = 'C' end |
Instance Attribute Details
#blood ⇒ Object
Returns the value of attribute blood.
6 7 8 |
# File 'lib/bloodchalice/chalice.rb', line 6 def blood @blood end |
#life ⇒ Object
Returns the value of attribute life.
6 7 8 |
# File 'lib/bloodchalice/chalice.rb', line 6 def life @life end |
#map ⇒ Object
Returns the value of attribute map.
6 7 8 |
# File 'lib/bloodchalice/chalice.rb', line 6 def map @map end |
#position ⇒ Object
Returns the value of attribute position.
6 7 8 |
# File 'lib/bloodchalice/chalice.rb', line 6 def position @position end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/bloodchalice/chalice.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/bloodchalice/chalice.rb', line 16 def to_s @value.to_s end |