2014-08-23 08:47:44 +03:00
|
|
|
package com.iluwatar;
|
|
|
|
|
|
|
|
public class PeacefulState implements State {
|
2014-10-08 13:42:12 +01:00
|
|
|
|
2014-08-23 08:47:44 +03:00
|
|
|
private Mammoth mammoth;
|
|
|
|
|
|
|
|
public PeacefulState(Mammoth mammoth) {
|
|
|
|
this.mammoth = mammoth;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void observe() {
|
|
|
|
System.out.println(String.format("%s is calm and peaceful.", mammoth));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnterState() {
|
|
|
|
System.out.println(String.format("%s calms down.", mammoth));
|
|
|
|
}
|
2014-10-08 13:42:12 +01:00
|
|
|
|
2014-08-23 08:47:44 +03:00
|
|
|
}
|