Ejemplo n.º 1
0
        public World Execute(string consoleInput, ParallelType pType = ParallelType.Sequential)
        {
            World world = new World(dwarves, routines);

            world.Run(consoleInput, pType);

            return(world);
        }
Ejemplo n.º 2
0
        public World Execute(string consoleInput, ParallelType pType = ParallelType.Sequential)
        {
            World world = new World(dwarves, routines);

            world.Run(consoleInput, pType);

            return world;
        }
Ejemplo n.º 3
0
        public World Execute(string consoleInput)
        {
            World world = new World(dwarves, routines);

            world.Run(consoleInput);

            return(world);
        }
Ejemplo n.º 4
0
        public World Execute(string consoleInput)
        {
            World world = new World(dwarves, routines);

            world.Run(consoleInput);

            return world;
        }
Ejemplo n.º 5
0
        public void MoveRightIntoWallTest()
        {
            Dictionary<string, List<Instruction>> routines = new Dictionary<string, List<Instruction>>();
            routines.Add("main", new List<Instruction>() { new MoveRight() });
            World w = new World(new List<Dwarf>() { new Dwarf("Urist", routines["main"]) }, routines);
            w.Dwarves[0].Position = 3;

            Assert.AreEqual(3, w.Dwarves[0].Position);
            w.Run("");
            Assert.AreEqual(3, w.Dwarves[0].Position);
        }
Ejemplo n.º 6
0
        public void DumpTest()
        {
            Dictionary<string, List<Instruction>> routines = new Dictionary<string, List<Instruction>>();
            routines.Add("main", new List<Instruction>() { new Dump() });
            World w = new World(new List<Dwarf>() { new Dwarf("Urist", routines["main"]) }, routines);
            w.Dwarves[0].Position = 3;
            w.Dwarves[0].Rocks = 1;

            w.Run("");
            Assert.AreEqual(0, w.Dwarves[0].Rocks);
            Assert.AreEqual(1, w.Cave[2].Rocks);
        }
Ejemplo n.º 7
0
        public void MineTest()
        {
            Dictionary<string, List<Instruction>> routines = new Dictionary<string, List<Instruction>>();
            routines.Add("main", new List<Instruction>() { new Mine() });
            World w = new World(new List<Dwarf>() { new Dwarf("Urist", routines["main"]) }, routines);
            w.Dwarves[0].Position = 3;

            Assert.AreEqual(0, w.Dwarves[0].Rocks);
            Assert.AreEqual(-1, w.Cave[4].Rocks);
            Assert.AreEqual(5, w.Cave.Count);
            w.Run("");
            Assert.AreEqual(1, w.Dwarves[0].Rocks);
            Assert.AreEqual(63, w.Cave[4].Rocks);
            Assert.AreEqual(-1, w.Cave[5].Rocks);
            Assert.AreEqual(6, w.Cave.Count);
        }