Skip to content

T_WolfCurses_Window_2

Maxwolf edited this page Jan 2, 2016 · 2 revisions

Window(TCommands, TData) Class

Facilitates the ability to control the entire simulation with the passes interface reference. Server simulation keeps track of all currently loaded game modes and will only tick the top-most one so they can be stacked and clear out until there are none.

Inheritance Hierarchy

System.Object
  System.Collections.Generic.Comparer(IWindow)
    WolfCurses.Window(TCommands, TData)
Namespace: WolfCurses
Assembly: WolfCurses (in WolfCurses.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public abstract class Window<TCommands, TData> : Comparer<IWindow>, 
	IComparable<Window<TCommands, TData>>, IEquatable<Window<TCommands, TData>>, 
	IEqualityComparer<Window<TCommands, TData>>, IWindow, IComparer<IWindow>, 
	IComparable<IWindow>, ITick
where TCommands : struct, new(), IComparable, IFormattable, IConvertible
where TData : new(), WindowData

Type Parameters

 

TCommands
Enumeration of all the available commands this window supports.
TData
Window data class that will be used for this window.
  The Window(TCommands, TData) type exposes the following members.

Constructors

 

Name Description
Protected method Window(TCommands, TData) Initializes a new instance of the Window(TCommands, TData) class.
  Back to Top

Properties

 

Name Description
Public property AcceptsInput Determines if user input is currently allowed to be typed and filled into the input buffer.
Public property CurrentForm Holds the current state which this Windows is in, a Windows will cycle through available states until it is finished and then detach.
Protected property MenuFooter Similar to the header this will define some text that should go below the menu selection but before the user input field.
Protected property MenuHeader Defines the text prefix which will go above the menu, used to show any useful information the game Windows might need to at the top of menu selections.
Public property ShouldRemoveMode Determines if the game Windows should not be ticked if it is active but instead removed. The Windows when set to being removed will not actually be removed until the simulation attempts to tick it and realizes that this is set to true and then it will be removed.
Protected property UserData Intended to be overridden in abstract class by generics to provide method to return object that contains all the data for parent game Windows.
  Back to Top

Methods

 

Name Description
Protected method AddCommand Adds a new game menu selection with description pulled from attribute on input enumeration. This override is not meant for menu selections where you want to manually specify the description of the menu item, this way it will be pulled from enum description attribute.
Protected method ClearCommands Forces the menu choices to be cleared out, this is used by modes like the store to refresh the data shown in the menu to match purchasing decisions.
Public method ClearForm Removes the current state from the active game Windows.
Public method Compare The compare. (Overrides Comparer(T).Compare(T, T).)
Public method CompareTo(IWindow) The compare to.
Public method CompareTo(Window(TCommands, TData)) The compare to.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Equals(Window(TCommands, TData)) The equals.
Public method Equals(Window(TCommands, TData), Window(TCommands, TData)) The equals.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode() The get hash code. (Overrides Object.GetHashCode().)
Public method GetHashCode(Window(TCommands, TData)) The get hash code.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnFormChange Allows underlying parent game Windows to the state understand it changed.
Protected method OnModeRemoved Fired when this game Windows is removed from the list of available and ticked modes in the simulation.
Public method OnRenderWindow Fired by simulation when it wants to request latest text user interface data for the game Windows, this is used to display to user console specific information about what the simulation wants.
Public method OnTick Called when the simulation is ticked by underlying operating system, game engine, or potato. Each of these system ticks is called at unpredictable rates, however if not a system tick that means the simulation has processed enough of them to fire off event for fixed interval that is set in the core simulation by constant in milliseconds.
Public method OnWindowActivate Called when the Windows manager in simulation makes this Windows the currently active game Windows. Depending on order of modes this might not get called until the Windows is actually ticked by the simulation.
Public method OnWindowAdded Fired when the simulation adds a game Windows that is not this Windows. Used to execute code in other modes that are not the active Windows anymore one last time.
Public method OnWindowPostCreate Called after the Windows has been added to list of modes and made active.
Public method RemoveWindowNextTick Sets the flag for this game Windows to be removed the next time it is ticked by the simulation.
Public method SendCommand Fired by messaging system or user interface that wants to interact with the simulation by sending string input that should be able to be parsed into a valid input that can be run on the current game Windows.
Public method SetForm Creates and adds the specified type of state to currently active game Windows.
Public method ToString The to string. (Overrides Object.ToString().)
  Back to Top

Extension Methods

 

Name Description
Public Extension Method ToDescriptionAttribute Attempts to grab description attribute from any object. (Defined by AttributeExtensions.)
  Back to Top

Version Information

Wolf Curses

Supported in: 0.1

See Also

Reference

WolfCurses Namespace

Clone this wiki locally