Module: BloodChalice::TileValues

Included in:
Chalice, Knight, Peasant, Player, Tile, Zombie
Defined in:
lib/bloodchalice/tile.rb

Instance Method Summary collapse

Instance Method Details

#chalice?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/bloodchalice/tile.rb', line 27

def chalice?
  @value == 'C'
end

#empty?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/bloodchalice/tile.rb', line 11

def empty?
  @value == ' '
end

#knight?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bloodchalice/tile.rb', line 23

def knight?
  @value == 'K'
end

#peasant?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/bloodchalice/tile.rb', line 15

def peasant?
  @value == 'P'
end

#player?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/bloodchalice/tile.rb', line 7

def player?
  @value.to_i > 0
end

#wall?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/bloodchalice/tile.rb', line 3

def wall?
  @value == '#'
end

#zombie?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/bloodchalice/tile.rb', line 19

def zombie?
  @value == 'Z'
end