Class: Battle::AI::MoveHeuristicBase
- Defined in:
- docs/5_Battle_30_AI_1_MoveHeuristic.rb
Overview
Class responsive of handling the heuristics of moves
Direct Known Subclasses
Defined Under Namespace
Classes: CuringMove, HealingMoves, ReflectMoves, Rest
Class Method Summary collapse
-
.new(db_symbol, level) ⇒ MoveHeuristicBase
Get a MoveHeuristic by db_symbol and level.
-
.register(db_symbol, klass, min_level = 0)
Register a new move heuristic.
Instance Method Summary collapse
-
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic.
-
#ignore_effectiveness? ⇒ Boolean
Is this heuristic ignoring effectiveness.
-
#ignore_power? ⇒ Boolean
Is this heuristic ignoring power.
-
#initialize(ignore_effectiveness = false, ignore_power = false, overwrite_move_kind_flag = false) ⇒ MoveHeuristicBase
constructor
Create a new MoveHeusristicBase.
-
#overwrite_move_kind_flag? ⇒ Boolean
Is this heuristic ignoring power.
Constructor Details
#initialize(ignore_effectiveness = false, ignore_power = false, overwrite_move_kind_flag = false) ⇒ MoveHeuristicBase
Create a new MoveHeusristicBase
10 11 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 10 def initialize(ignore_effectiveness = false, ignore_power = false, overwrite_move_kind_flag = false) end |
Class Method Details
.new(db_symbol, level) ⇒ MoveHeuristicBase
Get a MoveHeuristic by db_symbol and level
44 45 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 44 def new(db_symbol, level) end |
.register(db_symbol, klass, min_level = 0)
Note:
If there’s several min_level, the highest condition matching with current AI level is choosen.
Register a new move heuristic
38 39 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 38 def register(db_symbol, klass, min_level = 0) end |
Instance Method Details
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic
30 31 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 30 def compute(move, user, target, ai) end |
#ignore_effectiveness? ⇒ Boolean
Is this heuristic ignoring effectiveness
14 15 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 14 def ignore_effectiveness? end |
#ignore_power? ⇒ Boolean
Is this heuristic ignoring power
18 19 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 18 def ignore_power? end |
#overwrite_move_kind_flag? ⇒ Boolean
Is this heuristic ignoring power
22 23 |
# File 'docs/5_Battle_30_AI_1_MoveHeuristic.rb', line 22 def overwrite_move_kind_flag? end |