예제 #1
0
 public void Start()
 {
     PuzzlesStrategyFactoryMethod puzzlesStrategy = new PuzzlesStrategyFactoryMethod(_pictureBox.Image);
     IPuzzlesStrategy differentPuzzleStrategy = puzzlesStrategy.GetStrategy(PuzzlesConfigurations.StrategyTypeEnum.Different);
     List<Puzzle> puzzlesList = differentPuzzleStrategy.ExtractPuzzles();
     SetPuzzleImage setImagesToPuzzles = new SetPuzzleImage(_pictureBox);
     puzzlesList = setImagesToPuzzles.SetImage(puzzlesList);
     SetConjunctionBetweenPuzzles setConnection = new SetConjunctionBetweenPuzzles(puzzlesList, _form,_pictureBox);
     setConnection.SetConnection();
     basicPictureLocationList = puzzlesList.Clone<Puzzle>().ToList();
     ThrowPuzzlesOnDesk throwPuzzles = new ThrowPuzzlesOnDesk(_form, _pictureBox);
     mixedPictureLocationList = throwPuzzles.Throw(puzzlesList);
     eventHandlers = new PuzzleEventHandlers(_form, basicPictureLocationList, mixedPictureLocationList);
     eventHandlers.SetHandlers(_pictureBox);
 }
예제 #2
0
        public void Start()
        {
            PuzzlesStrategyFactoryMethod puzzlesStrategy         = new PuzzlesStrategyFactoryMethod(_pictureBox.Image);
            IPuzzlesStrategy             differentPuzzleStrategy = puzzlesStrategy.GetStrategy(PuzzlesConfigurations.StrategyTypeEnum.Different);
            List <Puzzle>  puzzlesList        = differentPuzzleStrategy.ExtractPuzzles();
            SetPuzzleImage setImagesToPuzzles = new SetPuzzleImage(_pictureBox);

            puzzlesList = setImagesToPuzzles.SetImage(puzzlesList);
            SetConjunctionBetweenPuzzles setConnection = new SetConjunctionBetweenPuzzles(puzzlesList, _form, _pictureBox);

            setConnection.SetConnection();
            basicPictureLocationList = puzzlesList.Clone <Puzzle>().ToList();
            ThrowPuzzlesOnDesk throwPuzzles = new ThrowPuzzlesOnDesk(_form, _pictureBox);

            mixedPictureLocationList = throwPuzzles.Throw(puzzlesList);
            eventHandlers            = new PuzzleEventHandlers(_form, basicPictureLocationList, mixedPictureLocationList);
            eventHandlers.SetHandlers(_pictureBox);
        }
예제 #3
0
 public void ThrowPuzzlesOnDeskTest()
 {
     ThrowPuzzlesOnDesk throwPuzzles = new ThrowPuzzlesOnDesk(formGameTable, pictureBox);
     List<Puzzle> puzzlesInDifferentLocation = throwPuzzles.Throw(puzzles);
     Assert.AreNotEqual(puzzlesInDifferentLocation[0].Location.X, 0);
 }