Sha256: be6e96dc5bce826079d76261fc69e46b22cd68f337c38ee9eb150bdec1296fab

Contents?: true

Size: 563 Bytes

Versions: 2

Compression:

Stored size: 563 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
  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

2 entries across 2 versions & 1 rubygems

Version Path
MonkeyEngine-2.0.2 lib/MonkeyAction/monkey_action_dead.rb
MonkeyEngine-2.0.1 lib/MonkeyAction/monkey_action_dead.rb