Class: Battle::Effects::EffectsHandler

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

Overview

Class responsive of handling the effects active on something (terrain, pokemon, bank position)

Instance Method Summary collapse

Constructor Details

#initializeEffectsHandler

Create a new effect handler



7
8
# File 'docs/5_Battle_06_Effects.rb', line 7

def initialize
end

Instance Method Details

#add(effect)

Add an effect

Parameters:



21
22
# File 'docs/5_Battle_06_Effects.rb', line 21

def add(effect)
end

#delete_specific_dead_effect(name)

Delete specific dead effect

Parameters:

  • name (Symbol)


53
54
# File 'docs/5_Battle_06_Effects.rb', line 53

def delete_specific_dead_effect(name)
end

#deleted_dead_effects

Delete all the effect that should be deleted



49
50
# File 'docs/5_Battle_06_Effects.rb', line 49

def deleted_dead_effects
end

#each(&block) {|effect| ... }

Note:

automatically calls deleted_dead_effects if a block is given

Call something on all effects

Parameters:

  • block (Proc)

    block that is called for the each process

Yield Parameters:



46
47
# File 'docs/5_Battle_06_Effects.rb', line 46

def each(&block)
end

#get(name = nil, &block) {|effect| ... } ⇒ EffectBase?

Get an effect using its name or a block

Parameters:

  • name (Symbol, nil) (defaults to: nil)

    name of the effect. Ignored if a block is given.

  • block (Proc, nil)

    (optional) block testing each effect

Yield Parameters:

Returns:



33
34
# File 'docs/5_Battle_06_Effects.rb', line 33

def get(name = nil, &block)
end

#get_all(name = nil, &block) {|effect| ... } ⇒ Array<EffectBase>, Array<NilClass>

Get every effects responding to a name or a block

Parameters:

  • name (Symbol, nil) (defaults to: nil)

    name of the effects. Ignored if a block is given.

  • block (Proc, nil)

    (optional) block testing each effect

Yield Parameters:

Returns:



40
41
# File 'docs/5_Battle_06_Effects.rb', line 40

def get_all(name = nil, &block)
end

#has?(name = nil, &block) {|effect| ... } ⇒ Boolean

Tell if an effect is present

Parameters:

  • name (Symbol, nil) (defaults to: nil)

    name of the effect. Ignored if a block is given.

  • block (Proc, nil)

    (optional) block testing each effect

Yield Parameters:

Returns:

  • (Boolean)

    if the effect is present



17
18
# File 'docs/5_Battle_06_Effects.rb', line 17

def has?(name = nil, &block)
end

#replace(effect, &block)

Replace the effects matching the block by the new one

Parameters:



26
27
# File 'docs/5_Battle_06_Effects.rb', line 26

def replace(effect, &block)
end

#update_counter

Update the counter of all effects



10
11
# File 'docs/5_Battle_06_Effects.rb', line 10

def update_counter
end