コード例 #1
0
ファイル: ExplorerService.cs プロジェクト: OliDow/Maze
        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;
        }
コード例 #2
0
 public WebExplorerNavigationEventArgs(ExplorerAction intAction, string strURL)
 {
     Action = intAction;
     URL = strURL;
 }