Skip to content

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

Closed
wants to merge 45 commits into from
Closed

203: Finite state machine pattern #1247

wants to merge 45 commits into from

Conversation

hrighter
Copy link
Contributor

Pull request description

for issue: #203
create a finite state machine pattern demo

@@ -0,0 +1,25 @@
---
layout: pattern
title: Finite state machine
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: Finite state machine
title: Finite State Machine

---
layout: pattern
title: Finite state machine
folder: Finite-state-machine
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
folder: Finite-state-machine
folder: finite-state-machine

layout: pattern
title: Finite state machine
folder: Finite-state-machine
permalink: /patterns/Finite-state-machine/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
permalink: /patterns/Finite-state-machine/
permalink: /patterns/finite-state-machine/



## Applicability
Use the Finite-state-machine pattern when
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the Finite-state-machine pattern when
Use the Finite State Machine pattern when


package com.iluwatar.finite.state.machine;

/**.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**.
/**

* 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
Copy link
Owner

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?

Copy link
Owner

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!");
Copy link
Owner

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.

@iluwatar
Copy link
Owner

@hrighter please comment when you're ready for another review.

@iluwatar
Copy link
Owner

iluwatar commented Aug 3, 2020

@hrighter The pull request has remained inactive and is about to be closed. Please comment if you're still working on it.

@ohbus ohbus added the status: stale issues and pull requests that have not had recent interaction label Dec 4, 2020
@ohbus
Copy link
Contributor

ohbus commented Mar 7, 2021

@hrighter this PR has been inactive for a long time, we will close it soon if we do not see any updates.

@iluwatar iluwatar added this to the 1.26.0 milestone Dec 29, 2021
@iluwatar
Copy link
Owner

Closed due to inactivity

@iluwatar iluwatar closed this Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stale issues and pull requests that have not had recent interaction status: under review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants