Class: Contest::AI::Base

Inherits:
Object show all
Defined in:
docs/6_Contest_30_AI.rb

Overview

Base class of AI, it holds the most important data

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scene, creature, level) ⇒ Base

Create a new AI instance

Parameters:



35
36
# File 'docs/6_Contest_30_AI.rb', line 35

def initialize(scene, creature, level)
end

Instance Attribute Details

#can_make_combo ⇒ Boolean (readonly)

Can the AI intentionally try to make a combo?

Returns:

  • (Boolean)


26
27
28
# File 'docs/6_Contest_30_AI.rb', line 26

def can_make_combo
  @can_make_combo
end

#can_see_move_appeal ⇒ Boolean (readonly)

Can the AI see a move's appeal?

Returns:

  • (Boolean)


20
21
22
# File 'docs/6_Contest_30_AI.rb', line 20

def can_see_move_appeal
  @can_see_move_appeal
end

#can_see_move_condition ⇒ Boolean (readonly)

Can the AI see a move's condition?

Returns:

  • (Boolean)


23
24
25
# File 'docs/6_Contest_30_AI.rb', line 23

def can_see_move_condition
  @can_see_move_condition
end

#creature ⇒ PFM::ContestCreature (readonly)

Get the creature the AI controls



14
15
16
# File 'docs/6_Contest_30_AI.rb', line 14

def creature
  @creature
end

#level ⇒ Integer (readonly)

Get the level of the AI

Returns:

  • (Integer)


17
18
19
# File 'docs/6_Contest_30_AI.rb', line 17

def level
  @level
end

#logic ⇒ Contest::Logic (readonly)

Get the Logic class of the contest

Returns:



11
12
13
# File 'docs/6_Contest_30_AI.rb', line 11

def logic
  @logic
end

#noise ⇒ Float (readonly)

Noise to be used in heuristics computations

Returns:

  • (Float)


29
30
31
# File 'docs/6_Contest_30_AI.rb', line 29

def noise
  @noise
end

#scene ⇒ Contest::Scene (readonly)

Get the scene that initialized the AI

Returns:



8
9
10
# File 'docs/6_Contest_30_AI.rb', line 8

def scene
  @scene
end

Class Method Details

.register(level, klass)

Register a new AI

Parameters:

  • level (Integer) —

    level of the AI

  • klass (Class<Base>)


45
46
# File 'docs/6_Contest_30_AI.rb', line 45

def register(level, klass)
end

.registered(level) ⇒ Class<Contest::AI::Base>

Get a registered AI

Parameters:

  • level (Integer) —

    level of the AI

Returns:



50
51
# File 'docs/6_Contest_30_AI.rb', line 50

def registered(level)
end

Instance Method Details

#trigger ⇒ Contest::Move

Get the action the AI wants to do

Returns:



39
40
# File 'docs/6_Contest_30_AI.rb', line 39

def trigger
end