1 18 19 package de.gulden.framework.amoda.generic.behaviour; 20 21 import de.gulden.framework.amoda.model.behaviour.*; 22 import de.gulden.framework.amoda.model.behaviour.Rule; 23 import java.util.*; 24 25 31 public class GenericRule extends GenericCommand implements Rule { 32 33 37 public Condition condition; 38 39 public Command command; 40 41 42 46 public void perform() { 47 if (getCondition().test()==true) { 48 getCommand().perform(); 49 } 50 } 51 52 public Condition getCondition() { 53 return condition; 54 } 55 56 public void setCondition(Condition _condition) { 57 condition = _condition; 58 } 59 60 public Command getCommand() { 61 return command; 62 } 63 64 public void setCommand(Command _command) { 65 command = _command; 66 } 67 68 } | Popular Tags |