示例#1
0
		public void ShowLogosAndWait()
		{
			var screen = Resolve<ScreenSpace>();
			var factory = new LogoFactory(screen);
			var logos = new List<Logo>();
			var n = 10; // randomizer.Get(10, 100);
			for (int i = 0; i < n; i++)
			{
				var logo = factory.Create();
				if (logo != null)
					logos.Add(logo);
			}
			Assert.IsTrue(logos.Count == n);
			if (!IsMockResolver)
				return;
			while (GlobalTime.Current.Milliseconds < 10000)
			{
				var mouse = Resolve<MockMouse>();
				mouse.SetButtonState(MouseButton.Left, State.Releasing);
				AdvanceTimeAndUpdateEntities(1);
				if (Time.CheckEvery(1))
				{
					Resolve<Window>().Title = "Logo count: " + logos.Count;
					logos.RemoveAll(x => x.IsOutside(screen.Viewport));
				}
			}
			Assert.IsTrue(logos.Count == 0);	
		}
示例#2
0
		public void CreateLogos()
		{
			var randomizer = new PseudoRandom();
			var factory = new LogoFactory(Resolve<ScreenSpace>());
			var logos = new List<Logo>();
			var n = randomizer.Get(10, 100);
			for (int i = 0; i < n; i++)
			{
				var logo = factory.Create();
				if (logo != null)
					logos.Add(logo);
			}
			Assert.IsTrue(logos.Count == n);
		}
示例#3
0
		public Match(ScreenSpace screen, NumberFactory numberFactory, LogoFactory logoFactory)
			: base(Rectangle.Zero)
		{
			this.screen = screen;
			this.logoFactory = logoFactory;
			hud = new HudScene(screen, numberFactory);
			pause = new PausePage(screen);
			pause.Hide();
			Slice = new Slice();
			PointsTips = new List<PointsTip>();
			ErrorFlags = new List<ErrorFlag>();
			HideScore();
			screen.ViewportSizeChanged += RefreshSize;
			RefreshSize();
		}