コード例 #1
0
 /// <summary>
 /// Strong Construction
 /// </summary>
 /// <param name="aGameUI"></param>
 public GameCoords(GameUI aGameUI)
 {
     GameUI = aGameUI;
     GlobalOffset = new VectorInt(10, 30);
     GlobalTileSize = new SizeInt(16, 16);
     windowRegion =  new RectangleInt(new VectorInt(0, 0), new SizeInt(400, 300));
 }
コード例 #2
0
ファイル: NodeBase.cs プロジェクト: rfrfrf/SokoSolve-Sokoban
        /// <summary>
        /// Semi-Strong construction
        /// </summary>
        /// <param name="myGameUI">Game to which the node belongs</param>
        /// <param name="myDepth">Z-Order</param>
        public NodeBase(GameUI myGameUI, int myDepth)
        {
            if (myGameUI == null) throw new ArgumentNullException("myGameUI");

            gameUI = myGameUI;
            depth = myDepth;
            dockPoint = DockPoint.Centre;
            size = new SizeInt(0, 0);
            currentAbsolute = VectorInt.Zero;
            isRemoved = false;
        }
コード例 #3
0
 public NodeStaticCell(GameUI myGameUI, Cell myCell, VectorInt myPuzzleLocation, int myDepth)
     : base(myGameUI, myCell, myPuzzleLocation, myDepth)
 {
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: rfrfrf/SokoSolve-Sokoban
        /// <summary>
        /// Exit the game, return to the 'caller'
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonDone_Click(object sender, EventArgs e)
        {
            gameUI.Active = false;

            timerAnimation.Enabled = false;
            gameUI = null;

            FormMain main = FindForm() as FormMain;
            if (main != null)
            {
                main.Mode = returnMode;
            }
        }
コード例 #5
0
ファイル: Game.cs プロジェクト: rfrfrf/SokoSolve-Sokoban
        /// <summary>
        /// Start the game
        /// </summary>
        /// <param name="puzzle"></param>
        /// <param name="map"></param>
        public void StartGameSolution(Puzzle puzzle, PuzzleMap map, Solution solution)
        {
            try
            {
                puzzleMap = map;
                gameUI = new GameUI(puzzle, map, solution);
                gameUI.OnExit += new EventHandler(gameUI_OnExit);
                gameUI.OnGameWin += new EventHandler<NotificationEvent>(gameUI_OnGameWin);
                Game_Resize(null, null);
                timerAnimation.Enabled = true;

                gameUI.StartSolution();
            }
            catch (Exception ex)
            {
                HandleGameException("During Game Startup", ex);
            }
        }
コード例 #6
0
ファイル: Game.cs プロジェクト: rfrfrf/SokoSolve-Sokoban
        /// <summary>
        /// Start the game
        /// </summary>
        /// <param name="puzzle"></param>
        /// <param name="map"></param>
        public void StartGame(Puzzle puzzle, PuzzleMap map)
        {
            try
            {
                puzzleMap = map;
                gameUI = new GameUI(puzzle, map, new WindowsSoundSubSystem());
                gameUI.OnExit += new EventHandler(gameUI_OnExit);
                gameUI.OnGameWin += new EventHandler<NotificationEvent>(gameUI_OnGameWin);
                gameUI.OnGameEvents += new EventHandler<NotificationEvent>(gameUI_OnGameEvents);

                Game_Resize(null, null);
                timerAnimation.Enabled = true;

                gameUI.Start();
            }
            catch (Exception ex)
            {
                HandleGameException("During Game Startup", ex);
            }
        }
コード例 #7
0
        private int moveWaitPeriod = 0; // frames

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Strong Construction
        /// </summary>
        /// <param name="myGameUI"></param>
        /// <param name="myPuzzleLocation"></param>
        /// <param name="myDepth"></param>
        public NodeDynamicPlayer(GameUI myGameUI, VectorInt myPuzzleLocation, int myDepth)
            : base(myGameUI, Cell.Player, myPuzzleLocation, myDepth)
        {
            futureMoves = new Queue<Direction>();
        }
コード例 #8
0
 /// <summary>
 /// Strong Construction
 /// </summary>
 /// <param name="myGameUI"></param>
 /// <param name="myCell"></param>
 /// <param name="myPuzzleLocation"></param>
 /// <param name="myDepth"></param>
 public NodeDynamic(GameUI myGameUI, Cell myCell, VectorInt myPuzzleLocation, int myDepth)
     : base(myGameUI, myCell, myPuzzleLocation, myDepth)
 {
     target = VectorInt.Null;
 }
コード例 #9
0
 public NodeDynamicCrate(GameUI myGameUI, VectorInt myPuzzleLocation, int myDepth)
     : base(myGameUI, Cell.Crate, myPuzzleLocation, myDepth)
 {
 }