Sha256: b5cc899b2f7d7c15d813807f1bdc88cc57a18e16f2cbb0fe5a755b07e05a914f

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

require_relative 'monkey_action'
require 'MonkeyEngine/exceptions'

# Monkey action:  dead (as in not alive)
# The monkey has been killed - the thread is not running.
class MonkeyActionDead < MonkeyAction
  WEIGHT = 100.0
  VALID_VALUES = [true].freeze

  def initialize(monkey)
    super monkey, true, WEIGHT

    validate

    self
  end

  protected

  def validate
    super

    raise MonkeyEngine::Exceptions::InvalidArgumentValueException, "Value '#{value}' is not a valid value"  \
      unless VALID_VALUES.include?(@value)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
MonkeyEngine-2.0.0 lib/MonkeyAction/monkey_action_dead.rb