コード例 #1
0
 @Override
 public Action getReplacementActionFor(Action action) {
   if (action.getClass().equals(WakeUpAction.class)) {
     if (die.nextInt(100) < _sleepInPercentage) {
       return new FallAsleepAction();
     }
     return new WakeUpAction();
   }
   return null;
 }
コード例 #2
0
 @Override
 public Boolean willReplaceAction(Action action) {
   return (action.getClass().equals(WakeUpAction.class));
 }