Class: BloodChalice::Chalice

Inherits:
Object
  • Object
show all
Includes:
Movable, TileValues
Defined in:
lib/bloodchalice/chalice.rb

Constant Summary

Constants included from Movable

Movable::DIRECTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @position = options[:position]
  @map = options[:map]
  @life = 400
  @blood = 0
  @value = 'C'
end

Instance Attribute Details

#bloodObject

Returns the value of attribute blood.



6
7
8
# File 'lib/bloodchalice/chalice.rb', line 6

def blood
  @blood
end

#lifeObject

Returns the value of attribute life.



6
7
8
# File 'lib/bloodchalice/chalice.rb', line 6

def life
  @life
end

#mapObject

Returns the value of attribute map.



6
7
8
# File 'lib/bloodchalice/chalice.rb', line 6

def map
  @map
end

#positionObject

Returns the value of attribute position.



6
7
8
# File 'lib/bloodchalice/chalice.rb', line 6

def position
  @position
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/bloodchalice/chalice.rb', line 6

def value
  @value
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/bloodchalice/chalice.rb', line 16

def to_s
  @value.to_s
end