public World Execute(string consoleInput, ParallelType pType = ParallelType.Sequential) { World world = new World(dwarves, routines); world.Run(consoleInput, pType); return(world); }
public World Execute(string consoleInput, ParallelType pType = ParallelType.Sequential) { World world = new World(dwarves, routines); world.Run(consoleInput, pType); return world; }
public World Execute(string consoleInput) { World world = new World(dwarves, routines); world.Run(consoleInput); return(world); }
public World Execute(string consoleInput) { World world = new World(dwarves, routines); world.Run(consoleInput); return world; }
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); }
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); }
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); }