Class: Agentilda::Runner::Round
- Inherits:
-
Data
- Object
- Data
- Agentilda::Runner::Round
- Defined in:
- lib/agentilda/runner.rb
Overview
One pass over the tree.
Instance Attribute Summary collapse
- #attempts ⇒ Array<Agentilda::Runner::Attempt> readonly
-
#number ⇒ Integer
readonly
1-based.
Instance Method Summary collapse
- #advanced ⇒ Integer
-
#dry? ⇒ Boolean
Nothing moved, so another identical round is pointless.
Instance Attribute Details
#attempts ⇒ Array<Agentilda::Runner::Attempt> (readonly)
51 52 53 54 55 56 57 |
# File 'lib/agentilda/runner.rb', line 51 Round = Data.define(:number, :attempts) do # @return [Integer] def advanced = attempts.count(&:advanced?) # @return [Boolean] nothing moved, so another identical round is pointless def dry? = advanced.zero? end |
#number ⇒ Integer (readonly)
Returns 1-based.
51 52 53 54 55 56 57 |
# File 'lib/agentilda/runner.rb', line 51 Round = Data.define(:number, :attempts) do # @return [Integer] def advanced = attempts.count(&:advanced?) # @return [Boolean] nothing moved, so another identical round is pointless def dry? = advanced.zero? end |
Instance Method Details
#advanced ⇒ Integer
53 |
# File 'lib/agentilda/runner.rb', line 53 def advanced = attempts.count(&:advanced?) |
#dry? ⇒ Boolean
Returns nothing moved, so another identical round is pointless.
56 |
# File 'lib/agentilda/runner.rb', line 56 def dry? = advanced.zero? |