Class: Battle::Logic::ChangeHandlerBase

Inherits:
Object
  • Object
show all
Defined in:
docs/01600_Alpha_25_Battle_Engine_00200_Battle_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:



704
705
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 704

def initialize(logic, scene)
end

Instance Attribute Details

#logicBattle::Logic (readonly)

Get the logic

Returns:



694
695
696
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 694

def logic
  @logic
end

#pre_checked_effectsArray<Battle::Effects::EffectBase]

Get the list of the pre-checked effects

Returns:



700
701
702
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 700

def pre_checked_effects
  @pre_checked_effects
end

#sceneBattle::Scene (readonly)

Get the scene

Returns:



697
698
699
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 697

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



715
716
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 715

def prevent_change(&reason)
end

#process_prevention_reason

Process the reason a change could not be done



707
708
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 707

def process_prevention_reason
end

#reset_prevention_reason

Reset the reason why change cannot be done



710
711
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 710

def reset_prevention_reason
end