class Natural20::Action

Attributes

action_type[R]
errors[R]
result[R]
session[R]
source[R]

Public Class Methods

apply!(battle, item) click to toggle source
# File lib/natural_20/actions/action.rb, line 30
def self.apply!(battle, item); end
new(session, source, action_type, opts = {}) click to toggle source
# File lib/natural_20/actions/action.rb, line 6
def initialize(session, source, action_type, opts = {})
  @source = source
  @session = session
  @action_type = action_type
  @errors = []
  @result = []
  @opts = opts
end

Public Instance Methods

label() click to toggle source
# File lib/natural_20/actions/action.rb, line 23
def label
  I18n.t(:"action.#{action_type}")
end
name() click to toggle source
# File lib/natural_20/actions/action.rb, line 15
def name
  @action_type.to_s
end
resolve(session, map, opts = {}) click to toggle source
# File lib/natural_20/actions/action.rb, line 32
def resolve(session, map, opts = {}); end
to_s() click to toggle source
# File lib/natural_20/actions/action.rb, line 19
def to_s
  @action_type.to_s.humanize
end
validate() click to toggle source
# File lib/natural_20/actions/action.rb, line 27
def validate
end

Protected Instance Methods

t(k, options = {}) click to toggle source
# File lib/natural_20/actions/action.rb, line 36
def t(k, options = {})
  I18n.t(k, **options)
end