Class: InventoryAction

Inherits:
Natural20::Action show all
Defined in:
lib/natural_20/actions/inventory_action.rb

Overview

typed: true

Instance Attribute Summary

Attributes inherited from Natural20::Action

#action_type, #errors, #result, #session, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Natural20::Action

apply!, #initialize, #label, #name, #resolve, #to_s, #validate

Constructor Details

This class inherits a constructor from Natural20::Action

Class Method Details

.can?(_entity, _battle) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/natural_20/actions/inventory_action.rb', line 3

def self.can?(_entity, _battle)
  true
end

Instance Method Details

#build_mapObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/natural_20/actions/inventory_action.rb', line 7

def build_map
  OpenStruct.new({
                   action: self,
                   param: [
                     {
                       type: :show_inventory,
                     },
                   ],
                   next: lambda { |_path|
                     OpenStruct.new({
                                            param: nil,
                                            next: -> { self },
                                          })
                   },
                 })
end