Ejemplo n.º 1
0
        public void FactoryMethodTest_ReturnsNewRobot_RobotTypeShouldBeCyborg()
        {
            //Arrange
            var cyborgCreator = new CyborgCreator();

            //Act
            Robot robotCreated = cyborgCreator.FactoryMethod();

            //Assert
            Assert.IsInstanceOfType(robotCreated, typeof(RobotCyborg));
        }
Ejemplo n.º 2
0
        public void GenerateNewGame()
        {
            Random rnd    = new Random();
            int    random = rnd.Next(10);

            if (random < 5)
            {
                Robot = new WorkerCreator().Create("workerimage");
            }
            else if (random > 7)
            {
                Robot = new ScientistCreator().Create("scientistimage");
            }
            else
            {
                Robot = new CyborgCreator().Create("cyborgimage");
            }
            Map         = new Map();
            GameHistory = new GameHistory();
            MoveCounter = 0;
        }
Ejemplo n.º 3
0
        public void GenerateNewGame()
        {
            Random rnd    = new Random();
            int    random = rnd.Next(10);

            if (random < 5)
            {
                Robot = new WorkingCreator().Create();
            }
            else if (random > 7)
            {
                Robot = new SmartCreator().Create();
            }
            else
            {
                Robot = new CyborgCreator().Create();
            }
            Console.WriteLine("Вам выпал робот: " + Robot.fullHero);
            //GamePole = new GamePole();
            GameHistory = new GameHistory();
            pole        = new GamePole(this, Robot);
        }