public CatChaserModified(Statemachine parent) {
super(parent);
setUpSonic.setImplicitTransitions(new ITransition[]{
new AbstractTransition(setUpSonic) {
public int getDelay() {
return 200;
}
}
});
welcomeDance.setImplicitTransitions(new ITransition[]{
new AbstractTransition(fullScanForCat) {
}
});
fullScanForCat.setImplicitTransitions(new ITransition[]{
new AbstractTransition(endState) {
public boolean guard() {
return min >= farAway;
}
}, new AbstractTransition(headToCat) {
}
});
headToCat.setImplicitTransitions(new ITransition[]{
new AbstractTransition(jumpAttack) {
public boolean guard() {
return dist < nearBy + 5;
}
public int getDelay() {
return 2500;
}
}, new AbstractTransition(endState) {
public boolean guard() {
return dist >= farAway;
}
}, new AbstractTransition(sneakApproach) {
}
});
sneakApproach.setTransitions(new ITransition[]{catDisappeared,
catNearBy});
closeScanForCat.setImplicitTransitions(new ITransition[]{
new AbstractTransition(headToCat) {
}
});
jumpAttack.setImplicitTransitions(new ITransition[]{
new AbstractTransition(closeScanForCat) {
}
});
jumpAttack.setTransitions(new ITransition[]{catDestroyed});
haHaHaHaHa.setImplicitTransitions(new ITransition[]{
new AbstractTransition(fullScanForCat) {
public int getDelay() {
return 1000;
}
}