Namespace: DeltaEngine.Rendering2D
Assembly: DeltaEngine.Rendering2D (in DeltaEngine.Rendering2D.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaNinja.Tests.Entities.LogoTests
2 unit tests call DeltaEngine.Rendering2D.HierarchyEntity2D.Add(DeltaEngine.Entities.HierarchyObject2D)
Assembly: DeltaEngine.Rendering2D (in DeltaEngine.Rendering2D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- child
- Type: DeltaEngine.Entities HierarchyObject2D
Implements
HierarchyObject2D Add(HierarchyObject2D)Remarks
Examples
[Test] 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); }
[Test, CloseAfterFirstFrame, Ignore] public void ShowLogosAndWait() { var screen = Resolve<ScreenSpace>(); var factory = new LogoFactory(screen); var logos = new List<Logo>(); var n = Randomizer.Current.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); }
See Also