示例#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
        /// <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;
        }
 public NodeStaticCell(GameUI myGameUI, Cell myCell, VectorInt myPuzzleLocation, int myDepth)
     : base(myGameUI, myCell, myPuzzleLocation, myDepth)
 {
 }
示例#4
0
        /// <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
        /// <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
        /// <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);
            }
        }
        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;
 }
 public NodeDynamicCrate(GameUI myGameUI, VectorInt myPuzzleLocation, int myDepth)
     : base(myGameUI, Cell.Crate, myPuzzleLocation, myDepth)
 {
 }