Namespace: DeltaEngine.Scenes
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Scenes.Tests.SceneTests
14 unit tests call DeltaEngine.Scenes.Scene.Add(DeltaEngine.Rendering2D.Entity2D)
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- control
- Type: DeltaEngine.Rendering2D Entity2D
Remarks
Examples
[Test, CloseAfterFirstFrame] public void AddingControlAddsToListOfControls() { Assert.AreEqual(0, scene.Controls.Count); var control = new EmptyControl(); scene.Add(control); Assert.AreEqual(1, scene.Controls.Count); Assert.AreEqual(control, scene.Controls[0]); }
[Test, CloseAfterFirstFrame] public void AddingListOfControl() { Assert.AreEqual(0, scene.Controls.Count); var controls = new List<EmptyControl> { new EmptyControl(), new EmptyControl() }; scene.Add(controls); Assert.AreEqual(2, scene.Controls.Count); }
[Test, CloseAfterFirstFrame] public void AddingControlTwiceOnlyAddsItOnce() { var control = new EmptyControl(); scene.Add(control); scene.Add(control); Assert.AreEqual(1, scene.Controls.Count); }
See Also