-
-
Notifications
You must be signed in to change notification settings - Fork 27k
203: Finite state machine pattern #1247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,25 @@ | |||
--- | |||
layout: pattern | |||
title: Finite state machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Finite state machine | |
title: Finite State Machine |
--- | ||
layout: pattern | ||
title: Finite state machine | ||
folder: Finite-state-machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folder: Finite-state-machine | |
folder: finite-state-machine |
layout: pattern | ||
title: Finite state machine | ||
folder: Finite-state-machine | ||
permalink: /patterns/Finite-state-machine/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
permalink: /patterns/Finite-state-machine/ | |
permalink: /patterns/finite-state-machine/ |
|
||
|
||
## Applicability | ||
Use the Finite-state-machine pattern when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the Finite-state-machine pattern when | |
Use the Finite State Machine pattern when |
|
||
package com.iluwatar.finite.state.machine; | ||
|
||
/**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**. | |
/** |
* In this demo, I create a scenario that there is a game character, who has three states. | ||
* States: Standing;Walking;Running | ||
* And also there are two events, which means you can create requests to control it. | ||
* Events: MOVING_ON;MOVING_OFF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the code however I see events such as MOVING_ON_OFF and MOVING_RUN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these events are not the easiest to understand. How about a different system like increasing and decreasing movement? From standing to walking to running and vice versa.
* A method which simulates Game character stop. | ||
*/ | ||
private void stop() { | ||
System.out.println("Stop running! Game character is standing now!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use logger for outputting. Check elsewhere too.
@hrighter please comment when you're ready for another review. |
@hrighter The pull request has remained inactive and is about to be closed. Please comment if you're still working on it. |
@hrighter this PR has been inactive for a long time, we will close it soon if we do not see any updates. |
Closed due to inactivity |
Pull request description
for issue: #203
create a finite state machine pattern demo