Esempio n. 1
0
        public static void Main()
        {
            System.Console.WriteLine("Creating random board.");
            PuzzleBoard           board           = new PuzzleBoard(5, 5);
            PuzzleBoardController boardController = new PuzzleBoardController(board);

            boardController.FillBoardWithNewOrbs();
            System.Console.WriteLine(boardController.GetBoardString());

            System.Console.WriteLine("Checking matches");
            boardController.CheckForMatches();
            boardController.CheckForCombos();
            System.Console.WriteLine(boardController.GetCombosString());

            if (boardController.ComboCount > 0)
            {
                System.Console.WriteLine("Moving matched orbs to the top");
                boardController.MoveMatchedOrbsToTheTop();
                System.Console.WriteLine(boardController.GetBoardString());

                System.Console.WriteLine("Assign new color to matched orbs");
                boardController.AssignNewColorToMatchedOrbs();
                boardController.ClearMatches();
                System.Console.WriteLine(boardController.GetBoardString());
            }
        }
Esempio n. 2
0
	private void GetAllComponents()
	{
		PuzzleBoardController = GetComponentInChildren<PuzzleBoardController>() as PuzzleBoardController;
		if (PuzzleBoardController == null)
		{
			throw new UnityException("PuzzleGameController must have a PuzzleBoardController component as a child.");
		}
		PuzzlePresentationController = GetComponentInChildren<PuzzlePresentationController>() as PuzzlePresentationController;
		if (PuzzlePresentationController == null)
		{
			throw new UnityException("PuzzleGameController must have a PuzzlePresentationController component as a child.");
		}
		GemSwapper = GetComponentInChildren<GemSwapper>() as GemSwapper;
		if (GemSwapper == null)
		{
			throw new UnityException("PuzzleGameController must have a GemSwapper component as a child.");
		}
	}
Esempio n. 3
0
 private void GetAllComponents()
 {
     PuzzleBoardController = GetComponentInChildren <PuzzleBoardController>() as PuzzleBoardController;
     if (PuzzleBoardController == null)
     {
         throw new UnityException("PuzzleGameController must have a PuzzleBoardController component as a child.");
     }
     PuzzlePresentationController = GetComponentInChildren <PuzzlePresentationController>() as PuzzlePresentationController;
     if (PuzzlePresentationController == null)
     {
         throw new UnityException("PuzzleGameController must have a PuzzlePresentationController component as a child.");
     }
     GemSwapper = GetComponentInChildren <GemSwapper>() as GemSwapper;
     if (GemSwapper == null)
     {
         throw new UnityException("PuzzleGameController must have a GemSwapper component as a child.");
     }
 }