Sha256: 03629b189acb4eb422d4033989941e5fcf24561d872abf894c34d4d8994e03a4

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true

require_relative 'monkey_action'
require 'MonkeyEngine/exceptions'

# Monkey action:  wake (as in from sleep)
# The monkey has awakened from sleep.
class MonkeyActionWake < MonkeyAction
  WEIGHT = 2.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_wake.rb