Inheritance Hierarchy
CreepyTowers.GUI MenuController
CreepyTowers.Tests.GUI MenuControllerSpy
Namespace: CreepyTowers.GUI
Assembly: CreepyTowers (in CreepyTowers.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The MenuController type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MenuController | Initializes a new instance of the MenuController class |
Methods
Name | Description | |
---|---|---|
Dispose | Releases all resources used by the MenuController | |
GetMenu MenuScene | ||
HideAllMenus | ||
HideAllVisibleMenus | ||
HideMenu MenuScene | ||
IsAnyMenuShown | ||
MoveMenuToBackground MenuScene | ||
MoveMenuToForeground MenuScene | ||
ShowMenu MenuScene |
Fields
Name | Description | |
---|---|---|
current | ||
menus |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void CannotCreateMenuControllerWithoutDisposing() { Assert.Throws<MenuController.MenuControllerAlreadyExists>(() => new MenuControllerSpy()); }
[Test, CloseAfterFirstFrame] public void GetCachedMenu() { Assert.AreEqual(0, spy.NumberOfCreatedMenus); var menu = MenuController.GetMenu<MockMenuScene>(); Assert.AreEqual(1, spy.NumberOfCreatedMenus); Assert.AreEqual(menu, MenuController.GetMenu<MockMenuScene>()); Assert.AreEqual(1, spy.NumberOfCreatedMenus); }
[Test, CloseAfterFirstFrame] public void ShowAndHideCachedMenu() { var menu = MenuController.GetMenu<MockMenuScene>(); Assert.IsFalse(menu.IsShown); MenuController.ShowMenu<MockMenuScene>(); Assert.IsTrue(menu.IsShown); MenuController.HideMenu<MockMenuScene>(); Assert.IsFalse(menu.IsShown); }
See Also