public System.Object result(System.Object s, Action a) { if (a is MoveToAction) { MoveToAction mta = (MoveToAction)a; return mta.getToLocation(); } // The Action is not understood or is a NoOp // the result will be the current state. return s; } }