public bool DoAction(MazeExplorer explorer, ExplorerAction action) { IExplorerActionStrategy strategy = null; switch (action) { case ExplorerAction.TurnLeft: strategy = new TurnLeftStrategy(); break; case ExplorerAction.TurnRight: strategy = new TurnRightStrategy(); break; case ExplorerAction.MoveForward: strategy = new MoveForwardStrategy(); break; case ExplorerAction.LookForward: strategy = new LookForwardStrategy(); break; case ExplorerAction.LookAround: strategy = new LookAroundStrategy(); break; } if (strategy != null) return strategy.DoAction(explorer); return false; }
public WebExplorerNavigationEventArgs(ExplorerAction intAction, string strURL) { Action = intAction; URL = strURL; }