// Flier$Ego.java [dynamic] public class Flier$Ego { // upstream interface. Must implement. public void Fly(Flier host, int x, int y, int altitude) { resetMetersFlown(); host.Takeoff(); for (int a=0; a < altitude; a++) host.Ascend(); while( !host.ThereYet(x, y) ) host.FlapTowards(x, y); for(int a = altitude; a > 0; a--) host.Descend(); host.Land(); } // private functions. Must implement. private void resetMetersFlown() { meters_flown = 0; } // attributes (specific to the role) private float meters_flown; // constructor (optional) Flier$Ego( Shrink shrink ) { resetMetersFlown(); shrink.register_personality( "Flier" ); } }