Class: Foxbat::FBPhaser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callback=(value) ⇒ Object (writeonly)

Sets the attribute callback

Parameters:

  • value

    the value to set the attribute callback to.



7
8
9
# File 'lib/foxbat/barrier.rb', line 7

def callback=(value)
  @callback = value
end

#limit=(value) ⇒ Object (writeonly)

Sets the attribute limit

Parameters:

  • value

    the value to set the attribute limit to.



7
8
9
# File 'lib/foxbat/barrier.rb', line 7

def limit=(value)
  @limit = value
end

Instance Method Details

#onAdvance(phase, parties) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/foxbat/barrier.rb', line 9

def onAdvance(phase, parties)
  if (phase + 1) == @limit
    true
  else
    @callback.call if @callback
    false
  end
end