mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 16:59:24 +00:00
Formatted all files to the same standard
This commit is contained in:
@@ -3,16 +3,16 @@ package com.iluwatar;
|
||||
/**
|
||||
*
|
||||
* Mammoth has internal state that defines its behavior.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Mammoth {
|
||||
|
||||
|
||||
private State state;
|
||||
|
||||
public Mammoth() {
|
||||
state = new PeacefulState(this);
|
||||
}
|
||||
|
||||
|
||||
public void timePasses() {
|
||||
if (state.getClass().equals(PeacefulState.class)) {
|
||||
changeStateTo(new AngryState(this));
|
||||
@@ -25,12 +25,12 @@ public class Mammoth {
|
||||
this.state = newState;
|
||||
this.state.onEnterState();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "The mammoth";
|
||||
}
|
||||
|
||||
|
||||
public void observe() {
|
||||
this.state.observe();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user