class Field
Attributes
allowed[RW]
letterValue[RW]
posX[RW]
posY[RW]
stone[RW]
wordValue[RW]
Public Class Methods
new(x, y, wVal,lVal,img)
click to toggle source
# File lib/field.rb, line 3 def initialize(x, y, wVal,lVal,img) @posX = x @posY = y @wordValue = wVal #word multiplicator bonus @letterValue = lVal #letter multiplicator bonus @stone = nil #stone on field @image = img #image shown if is field available for placing stone @allowed = false #should field be shown end
Public Instance Methods
assingStone(stone)
click to toggle source
# File lib/field.rb, line 13 def assingStone(stone) #assigne stone to this field @stone = stone @stone.posX = @posX @stone.posY = @posY @stone.myField = self end
clicked()
click to toggle source
# File lib/field.rb, line 26 def clicked #because field is placed in @activeObjects end
draw()
click to toggle source
# File lib/field.rb, line 20 def draw if @stone == nil && @allowed @image.draw(@posX, @posY, 2) end end
update()
click to toggle source
# File lib/field.rb, line 29 def update #because field is placed in @activeObjects end