Module: Battle::SceneMock

Defined in:
docs/5_Battle_30_AI.rb

Overview

Module responsive of mocking the battle scene so nothing happen on the reality

How to use:

scene = @scene.clone
scene.extend(SceneMock)

Note: super inside this script might call the original function

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mock_actions ⇒ Array<Hash> (readonly)

Get the mock actions

Returns:

  • (Array<Hash>)


18
19
20
# File 'docs/5_Battle_30_AI.rb', line 18

def mock_actions
  @mock_actions
end

Class Method Details

.extended(mod)

Method called when a scene gets mocked (through extend)

Parameters:



13
14
# File 'docs/5_Battle_30_AI.rb', line 13

def extended(mod)
end

Instance Method Details

#display_message ⇒ Integer

Note:

This method ensures that no message is displayed during the mock

Mock method called to display a message without waiting for user input

Returns:

  • (Integer) —

    the id of the message



39
40
# File 'docs/5_Battle_30_AI.rb', line 39

def display_message(*)
end

#display_message_and_wait ⇒ Integer

Note:

This method ensures that no message is displayed during the mock

Mock method called to display a message and wait for user input

Returns:

  • (Integer) —

    the id of the message



34
35
# File 'docs/5_Battle_30_AI.rb', line 34

def display_message_and_wait(*)
end

#message_window ⇒ nil

Note:

This method ensures that no message window is used during the mock

Mock method called to get the message window

Returns:

  • (nil)


29
30
# File 'docs/5_Battle_30_AI.rb', line 29

def message_window
end

#mock_clear_actions

Function that clears the mock actions



24
25
# File 'docs/5_Battle_30_AI.rb', line 24

def mock_clear_actions
end

#mock_push_action(data)

Function that pushes an action to the action array (thing that happens during execution)

Parameters:

  • data (Hash)


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

def mock_push_action(data)
end

#update ⇒ nil

Mock update method that does nothing

Returns:

  • (nil)


43
44
# File 'docs/5_Battle_30_AI.rb', line 43

def update
end