MenuController ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  CreepyTowers.GUI MenuController
    CreepyTowers.Tests.GUI MenuControllerSpy

Namespace: CreepyTowers.GUI
Assembly: CreepyTowers (in CreepyTowers.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public class MenuController : IDisposable

The MenuController type exposes the following members.

Constructors

  NameDescription
Public methodMenuController
Initializes a new instance of the MenuController class
Top
Methods

  NameDescription
Public methodDispose
Releases all resources used by the MenuController
Public methodStatic memberGetMenu MenuScene 
Public methodStatic memberHideAllMenus
Public methodStatic memberHideAllVisibleMenus
Public methodStatic memberHideMenu MenuScene 
Public methodStatic memberIsAnyMenuShown
Public methodStatic memberMoveMenuToBackground MenuScene 
Public methodStatic memberMoveMenuToForeground MenuScene 
Public methodStatic memberShowMenu MenuScene 
Top
Fields

  NameDescription
Protected fieldStatic membercurrent
Protected fieldmenus
Top
Remarks

Tests: CreepyTowers.Tests.GUI.MenuControllerTests
Examples

9 unit tests call CreepyTowers.GUI.MenuController
[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