Ejemplo n.º 1
0
		public void CreateDefaultInputCommandsIfContentNotFound()
		{
			var inputCommands = ContentLoader.Load<NotExistingInputCommands>("NotExistingInputCommands");
			inputCommands.InternalCreateDefault();
			var exitCommand = new Command(Command.Exit, (Action)null);
			List<Trigger> triggers = exitCommand.GetTriggers();
			Assert.AreEqual(1, triggers.Count);
			Assert.AreEqual("KeyTrigger", triggers[0].GetShortNameOrFullNameIfNotFound());
		}
Ejemplo n.º 2
0
		private void CreateGameCamera(float minZoom, float maxZoom, float zoomSmoothingFactor)
		{
			orthoCamera = Camera.Use<OrthoCamera>();
			orthoCamera.Position = new Vector3D(transformedPosition, CameraHeight);
			orthoCamera.MinZoom = minZoom;
			orthoCamera.MaxZoom = maxZoom;
			orthoCamera.ZoomSmoothFactor = zoomSmoothingFactor;
			orthoCamera.ZoomLevel = minZoom;
			moveCommand = new Command(GameCommands.ViewPanning.ToString(), MoveCameraByMouse);
			zoomCommand = new Command(GameCommands.ViewZooming.ToString(), orthoCamera.Zoom);
			turnRightCommand = new Command(GameCommands.TurnViewRight.ToString(), TurnRight);
			turnLeftCommand = new Command(GameCommands.TurnViewLeft.ToString(), TurnLeft);
		}
Ejemplo n.º 3
0
		public void TestPausable()
		{
			var command = new Command(() => { });
			Assert.IsFalse(command.IsPauseable);
		}
Ejemplo n.º 4
0
		public void RegisterCommandWithSeveralTriggers()
		{
			const string CommandName = "CommandWithSeveralTriggers";
			var trigger1 = new MockTrigger();
			var trigger2 = new MockTrigger();
			Command.Register(CommandName, trigger1, trigger2);
			var command = new Command(CommandName, (Action)null);
			Assert.AreEqual(2, command.GetTriggers().Count);
		}