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:



711
712
# File 'docs/5_Battle_04_Logic.rb', line 711

def initialize(logic, scene)
end

Instance Attribute Details

#logicBattle::Logic (readonly)

Get the logic

Returns:



701
702
703
# File 'docs/5_Battle_04_Logic.rb', line 701

def logic
  @logic
end

#pre_checked_effectsArray<Battle::Effects::EffectBase]

Get the list of the pre-checked effects

Returns:



707
708
709
# File 'docs/5_Battle_04_Logic.rb', line 707

def pre_checked_effects
  @pre_checked_effects
end

#sceneBattle::Scene (readonly)

Get the scene

Returns:



704
705
706
# File 'docs/5_Battle_04_Logic.rb', line 704

def scene
  @scene
end

Instance Method Details

#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 hooks



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

def prevent_change(&reason)
end

#process_prevention_reason

Process the reason a change could not be done



714
715
# File 'docs/5_Battle_04_Logic.rb', line 714

def process_prevention_reason
end

#reset_prevention_reason

Reset the reason why change cannot be done



717
718
# File 'docs/5_Battle_04_Logic.rb', line 717

def reset_prevention_reason
end