Client LuaCsForBarotrauma
BallastFloraStateMachine.cs
1
#nullable enable
2
namespace
Barotrauma.MapCreatures.Behavior
3
{
4
class
BallastFloraStateMachine
5
{
6
private
readonly BallastFloraBehavior parent;
7
8
public
BallastFloraStateMachine
(BallastFloraBehavior parent)
9
{
10
this.parent = parent;
11
}
12
13
private
IBallastFloraState
? lastState;
14
public
IBallastFloraState
?
State
;
15
16
public
void
EnterState
(
IBallastFloraState
newState)
17
{
18
lastState =
State
;
19
State
?.
Exit
();
20
State
=
null
;
21
22
newState.
Enter
();
23
State
= newState;
24
}
25
26
public
void
Update
(
float
deltaTime)
27
{
28
if
(
State
==
null
)
29
{
30
EnterState
(
new
GrowIdleState(parent));
31
return
;
32
}
33
34
State
.
Update
(deltaTime);
35
36
switch
(
State
.
GetState
())
37
{
38
case
ExitState
.Running:
39
break
;
40
case
ExitState
.ReturnLast when lastState !=
null
&& lastState.
GetState
() ==
ExitState
.Running:
41
EnterState
(lastState);
42
break
;
43
default
:
44
EnterState
(
new
GrowIdleState(parent));
45
break
;
46
}
47
}
48
}
49
}
Barotrauma.MapCreatures.Behavior.BallastFloraStateMachine
Definition:
BallastFloraStateMachine.cs:5
Barotrauma.MapCreatures.Behavior.BallastFloraStateMachine.Update
void Update(float deltaTime)
Definition:
BallastFloraStateMachine.cs:26
Barotrauma.MapCreatures.Behavior.BallastFloraStateMachine.State
IBallastFloraState? State
Definition:
BallastFloraStateMachine.cs:14
Barotrauma.MapCreatures.Behavior.BallastFloraStateMachine.BallastFloraStateMachine
BallastFloraStateMachine(BallastFloraBehavior parent)
Definition:
BallastFloraStateMachine.cs:8
Barotrauma.MapCreatures.Behavior.BallastFloraStateMachine.EnterState
void EnterState(IBallastFloraState newState)
Definition:
BallastFloraStateMachine.cs:16
Barotrauma.MapCreatures.Behavior.IBallastFloraState
Definition:
IBallastFloraState.cs:15
Barotrauma.MapCreatures.Behavior.IBallastFloraState.Enter
void Enter()
Barotrauma.MapCreatures.Behavior.IBallastFloraState.Update
void Update(float deltaTime)
Barotrauma.MapCreatures.Behavior.IBallastFloraState.Exit
void Exit()
Barotrauma.MapCreatures.Behavior.IBallastFloraState.GetState
ExitState GetState()
Barotrauma.MapCreatures.Behavior
Definition:
BarotraumaShared/SharedSource/Map/Creatures/BallastFloraBehavior.cs:16
Barotrauma.MapCreatures.Behavior.ExitState
ExitState
Definition:
IBallastFloraState.cs:8
Barotrauma
BarotraumaShared
SharedSource
Map
Creatures
State
BallastFloraStateMachine.cs
Generated by
1.9.1