LUADOC - Farming Simulator 19

Script v1.7.1.0

Engine v1.7.1.0

Foundation Reference

PlayerStateBase

Functions

activate

Description
Activate method
Definition
activate()
Code
46function PlayerStateBase:activate()
47 self.isActive = true
48end

deactivate

Description
Deactivate method
Definition
deactivate()
Code
52function PlayerStateBase:deactivate()
53 self.isActive = false
54end

debugDraw

Description
Definition
debugDraw()
Code
74function PlayerStateBase:debugDraw(dt)
75end

delete

Description
Load method
Definition
delete()
Code
36function PlayerStateBase:delete()
37end

getStateMachine

Description
Get manager
Definition
getStateMachine()
Code
79function PlayerStateBase:getStateMachine()
80 return self.stateMachine
81end

inDebugMode

Description
Check if we are in debug mode
Definition
inDebugMode()
Code
68function PlayerStateBase:inDebugMode()
69 return self.isInDebugMode
70end

load

Description
Load method
Definition
load()
Code
41function PlayerStateBase:load()
42end

new

Description
Creating instance of player state.
Definition
new(table player, table stateMachine, table custom_mt)
Arguments
tableplayerinstance of player
tablestateMachineinstance of the state machine manager
tablecustom_mtmeta table
Return Values
tableinstanceinstance of object
Code
20function PlayerStateBase:new(player, stateMachine, custom_mt)
21 if custom_mt == nil then
22 custom_mt = PlayerStateBase_mt
23 end
24 local self = setmetatable({}, custom_mt)
25
26 self.isActive = false
27 self.isInDebugMode = false
28 self.player = player
29 self.stateMachine = stateMachine
30
31 return self
32end

toggleDebugMode

Description
Toggle debug mode
Definition
toggleDebugMode()
Code
58function PlayerStateBase:toggleDebugMode()
59 if self.isInDebugMode then
60 self.isInDebugMode= false
61 else
62 self.isInDebugMode= true
63 end
64end

update

Description
Update method
Definition
update(float dt)
Arguments
floatdtdelta time in ms
Code
86function PlayerStateBase:update(dt)
87end

updateTick

Description
Network tick update method
Definition
updateTick(float dt)
Arguments
floatdtdelta time in ms
Code
92function PlayerStateBase:updateTick(dt)
93end