Class: Battle::Logic::ChangeHandlerBase

Inherits:
Object
  • Object
show all
Defined in:
docs/5_Battle_04_Logic.rb

Overview

Class responsive of describing the minimum functionality of change handlers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logic, scene) ⇒ ChangeHandlerBase

Create a new ChangeHandler

Parameters:



730
731
# File 'docs/5_Battle_04_Logic.rb', line 730

def initialize(logic, scene)
end

Instance Attribute Details

#logic ⇒ Battle::Logic (readonly)

Get the logic

Returns:



720
721
722
# File 'docs/5_Battle_04_Logic.rb', line 720

def logic
  @logic
end

#pre_checked_effects ⇒ Array<Battle::Effects::EffectBase]

Get the list of the pre-checked effects

Returns:



726
727
728
# File 'docs/5_Battle_04_Logic.rb', line 726

def pre_checked_effects
  @pre_checked_effects
end

#scene ⇒ Battle::Scene (readonly)

Get the scene

Returns:



723
724
725
# File 'docs/5_Battle_04_Logic.rb', line 723

def scene
  @scene
end

Instance Method Details

#pass_change(&reason) ⇒ :passthrough

Function that register a reason why the change is possible

Parameters:

  • reason (Proc) —

    reason that will be registered

Returns:

  • (:passthrough) —

    :passthrough to make easier the return of effects



748
749
# File 'docs/5_Battle_04_Logic.rb', line 748

def pass_change(&reason)
end

#prevent_change(&reason) ⇒ :prevent

Function that register a reason why the change is not possible

Parameters:

  • reason (Proc) —

    reason that will be registered

Returns:

  • (:prevent) —

    :prevent to make easier the return of effects



743
744
# File 'docs/5_Battle_04_Logic.rb', line 743

def prevent_change(&reason)
end

#process_reason Also known as: process_prevention_reason

Process the reason a change can(not) be done



733
734
# File 'docs/5_Battle_04_Logic.rb', line 733

def process_reason
end

#reset_reason Also known as: reset_prevention_reason

Reset the reason a change can(not) be done



736
737
# File 'docs/5_Battle_04_Logic.rb', line 736

def reset_reason
end