Exemplo n.º 1
0
        static void Main(string[] args)
        {
            /* Player Auto explor

            string str = "satish";
            Convert.ToInt32(str[1]);
            Terrain terrain = new Terrain();
            terrain.PrepareTerrainFromXml(@"ConfigurationFiles\TerrainGraph.xml");
            var player = new Player() { Name = "Akrem" };
            terrain.Subscribe(TripRecorder.Instance);

            var terrainExplore = new TerrainAutoExploration(player, terrain);
            //Call the automated Exploration method
            terrainExplore.Explore();
            */

            // this is a test
            Terrain terrain = new Terrain();
            terrain.PrepareInteractiveTerrainFromXml(@"ConfigurationFiles\InteractiveTerrainGraph.xml");

            Player player = new Player();
            player.PreparePlayerFromXml(@"ConfigurationFiles\PlayerConfiguration.xml");

            terrain.InteractiveExplore(player);
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     Console.WriteLine("ENTER: 1 -> AutoPlayer; 2-> InteractivePlayer; 3->InteractiveWithMonters; 0->exit");
     Terrain terrain = new Terrain();
     IActor James;
     switch (Console.ReadLine())
     {
         case "0":
             Environment.Exit(1);
             break;
         case "1":
             James = new Actor();
             James.Name = "James";
             terrain.ConstructAndStartGame(James, new PlayerAutoExploreStrategy(), @"ConfigurationFiles\TerrainGraph.xml");
             break;
         case "2":
             James = new Player();
             James.ConstuctActor(@"ConfigurationFiles\PlayerConfiguration.xml");
             terrain.ConstructAndStartGame(James, new InteractiveStrategy(), @"ConfigurationFiles\InteractiveTerrainGraph.xml");
             break;
         case "3":
             James = new Player();
             James.ConstuctActor(@"ConfigurationFiles\PlayerConfiguration.xml");
             terrain.ConstructAndStartGame(James, new MultiCreatureAndExploreStrategy(new InteractiveStrategy()), @"ConfigurationFiles\MultiCreaturesTerrain.xml");
             Console.WriteLine("With Monsters");
             break;
         default:
             Console.WriteLine("Not valid choise. To Start again press 1 and then enter");
             if (Console.ReadLine() == "1")
                 Main(args);
             break;
     }
     Console.ReadKey();
 }
Exemplo n.º 3
0
        public void UTEnterLocation()
        {
            Player player = new Player();
            player.NumberOfLives = 2;

            waterLocation.AddNeighbor(new Location("tempLoc"), Directions.North);
            Assert.IsFalse(waterLocation.MoveToNeighbor(player, Directions.North));
            Assert.AreEqual(1, player.NumberOfLives);

            waterLocation.SwitchBridge();
        }
Exemplo n.º 4
0
 public void Setup()
 {
     player = new Player();
 }