Input Commands are loaded via the InputCommands.xml file, see InputCommands.cs for details.
You can also create your own commands, which will be executed whenever any trigger is invoked.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Commands Command
Namespace: DeltaEngine.Commands
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Command type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Command(Action) | Initializes a new instance of the Command class | |
Command(Action Single ) | Initializes a new instance of the Command class | |
Command(Action Vector2D ) | Initializes a new instance of the Command class | |
Command(Action Vector2D, Vector2D, Boolean ) | Initializes a new instance of the Command class | |
Command(String, Action) | Initializes a new instance of the Command class | |
Command(String, Action Vector2D ) | Initializes a new instance of the Command class | |
Command(String, Action Single ) | Initializes a new instance of the Command class | |
Command(String, Action Vector2D, Vector2D, Boolean ) | Initializes a new instance of the Command class |
Methods
Name | Description | |
---|---|---|
Add(Trigger) | ||
Add T (T) | (Inherited from Entity.) | |
AddTag | (Inherited from Entity.) | |
ClearTags | (Inherited from Entity.) | |
Contains T | (Inherited from Entity.) | |
ContainsBehavior T | (Inherited from Entity.) | |
ContainsTag | (Inherited from Entity.) | |
Deactivate | (Inherited from Entity.) | |
Dispose | (Inherited from Entity.) | |
Get T |
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D)
View code on GitHub (Inherited from Entity.) | |
GetActiveBehaviors | (Inherited from Entity.) | |
GetComponentsForSaving | (Inherited from Entity.) | |
GetOrDefault T | (Inherited from Entity.) | |
GetTags | (Inherited from Entity.) | |
GetTriggers | ||
Register | ||
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
Set | (Inherited from Entity.) | |
SetComponents | (Inherited from Entity.) | |
Start T | (Inherited from Entity.) | |
Stop T | (Inherited from Entity.) | |
ToString | (Inherited from Entity.) | |
Update |
Fields
Name | Description | |
---|---|---|
Back |
Go back one screen, normally unbound except if scene allows it. Right click or back button.
View code on GitHub | |
Click | ||
components | (Inherited from Entity.) | |
DoubleClick | ||
Drag | ||
DualDrag | ||
Exit |
Exits whole application (or scene) if supported. Mostly handled by the platform (Alt+F4).
View code on GitHub | |
Flick | ||
Hold | ||
MiddleClick | ||
MoveDirectly |
Allows to move left, right, up or down using ASDW or the cursor keys or an onscreen stick.
View code on GitHub | |
MoveDown | ||
MoveLeft | ||
MoveRight | ||
MoveUp | ||
Pinch | ||
RightClick | ||
RotateAround | ||
RotateDirectly |
Rotate in 3D space, normally bound to the mouse, game pad thumb stick or onscreen stick.
View code on GitHub | |
Zoom |
Properties
Name | Description | |
---|---|---|
IsActive | (Inherited from Entity.) | |
IsPauseable | (Overrides Entity IsPauseable.) | |
NumberOfComponents | (Inherited from Entity.) | |
UpdatePriority | (Inherited from Entity.) |
Remarks
Examples
[Test] public void CreateCommandWithManualTrigger() { customTrigger = new MockTrigger(); new Command(() => pos += Time.Delta).Add(customTrigger); InvokingTriggerWithoutRunningEntitiesDoesNotCauseAction(); InvokingTriggerOnceWithMultipleRunsOnlyCausesOneAction(); }
[Test] public void CommandIsNotPausable() { Assert.IsFalse(new Command(() => { }).IsPauseable); }
[Test] public void UnableToRegisterCommandWithoutNameOrTriggers() { Assert.Throws<ArgumentNullException>(() => Command.Register("", null)); Assert.Throws<Command.UnableToRegisterCommandWithoutTriggers>( () => Command.Register("a", null)); }
See Also