Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Campaign"/> class.
 /// </summary>
 /// <param name="name">The name of the campaign.</param>
 /// <param name="engine">The engine that will run the campaign.</param>
 protected Campaign(string name, Engine.Engine engine)
 {
     this.name = name;
     this.engine = engine;
     this.characters = new Dictionary<string, Character>();
     this.items = new Dictionary<string, Item>();
     this.inventoryItems = new Dictionary<string, InventoryItem>();
     this.rooms = new Dictionary<string, Room>();
 }
Beispiel #2
0
 public void GameBoardToStringSixBySix()
 {
     int gameBoardSize = 6;
     var target = new GameBoard(gameBoardSize);
     string expected = "  1 16 17 18 19 20\r\n 15  2 27 28 29 21\r\n 14 31  3 26 30 22\r\n 13 36 32  4 25 23\r\n 12 35 34 33  5 24\r\n 11 10  9  8  7  6\r\n";
     Engine engine = new Engine(gameBoardSize);
     var result = engine.Run();
     Assert.AreEqual(expected, result);
 }
Beispiel #3
0
public Ship()
	{JustEntered = false;
 frame = World.frame;
		UnityShip = UnityShip.Instantiate();
		SideEngine = new Engine((

(new Cons<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>(new Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>(KeyCode.A,new Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>(20f,new UnityEngine.Vector3(-1f,0f,0f))),(new Cons<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>(new Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>(KeyCode.D,new Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>(-20f,new UnityEngine.Vector3(1f,0f,0f))),(new Empty<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>()).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>())).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>())).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>()).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>());
		FrontEngine = new Engine((

(new Cons<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>(new Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>(KeyCode.X,new Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>(25f,new UnityEngine.Vector3(0f,0f,3f))),(new Cons<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>(new Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>(KeyCode.W,new Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>(20f,new UnityEngine.Vector3(0f,0f,1f))),(new Cons<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>(new Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>(KeyCode.S,new Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>(-20f,new UnityEngine.Vector3(0f,0f,-1f))),(new Empty<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>()).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>())).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>())).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>())).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>()).ToList<Casanova.Prelude.Tuple<UnityEngine.KeyCode, Casanova.Prelude.Tuple<System.Single, UnityEngine.Vector3>>>());
		
}
Beispiel #4
0
        public static void Main()
        {
            Console.Write("Enter a positive number [1..100]: ");
            string input = Console.ReadLine();
            int size = 0;
            while (!int.TryParse(input, out size))
            {
                Console.WriteLine("You haven't entered a valid number!");
                Console.Write("Enter a positive number [1..100]: ");
                input = Console.ReadLine();
            }

            try
            {
                Engine engine = new Engine(size);
                Console.WriteLine(engine.Run());
            }
            catch (ArgumentOutOfRangeException ex)
            {
                Console.WriteLine("You have entered a value out of allowed range");
            }
        }
 public void MapNivel1()
 {
     Engine.Draw(fondo);
     tilemap.Dibujar();
 }
Beispiel #6
0
 public void GameBoardToStringTwoByTwo()
 {
     int gameBoardSize = 2;
     var target = new GameBoard(gameBoardSize);
     string expected = "  1  4\r\n  3  2\r\n";
     Engine engine = new Engine(gameBoardSize);
     var result = engine.Run();
     Assert.AreEqual(expected, result);
 }
Beispiel #7
0
 public void Render()
 {
     Engine.Draw(currentAnimation.CurrentFrame, Position.X, Position.Y, scale, scale, angle, GetOffsetX(), GetOffsetY());
 }