Handles the falling and upcoming blocks.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
Blocks Controller
Namespace: Blocks
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The Controller type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Controller | Initializes a new instance of the Controller class |
Methods
Name | Description | |
---|---|---|
Add 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.) | |
MoveBlockLeftIfPossible | ||
MoveBlockRightIfPossible | ||
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
RotateBlockAntiClockwiseIfPossible | ||
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 | |
---|---|---|
components | (Inherited from Entity.) | |
content | ||
displayMode |
Properties
Name | Description | |
---|---|---|
FallingBlock | ||
GameRunning | ||
IsActive | (Inherited from Entity.) | |
IsFallingFast | ||
IsPauseable | (Inherited from Entity.) | |
NumberOfComponents | (Inherited from Entity.) | |
UpcomingBlock | ||
UpdatePriority | (Inherited from Entity.) |
Events
Name | Description | |
---|---|---|
AddToScore | ||
Lose |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void RunCreatesFallingAndUpcomingBlocks() { AdvanceTimeAndUpdateEntities(0.1f); Assert.IsNotNull(controller.FallingBlock); Assert.IsNotNull(controller.UpcomingBlock); }
[Test, CloseAfterFirstFrame] public void DropSlowAffixesBlocksSlowly() { controller.IsFallingFast = false; controller.FallingBlock = new Block(displayMode, content, Vector2D.One); controller.UpcomingBlock = new Block(displayMode, content, Vector2D.One); AdvanceTimeAndUpdateEntities(0.1f); Assert.AreEqual(0, CountBricks(grid)); AdvanceTimeAndUpdateEntities(1.5f); Assert.AreEqual(0, CountBricks(grid)); AdvanceTimeAndUpdateEntities(9.0f); Assert.AreEqual(4, CountBricks(grid), 1); }
[Test, CloseAfterFirstFrame] public void DropFastAffixesBlocksQuickly() { controller.IsFallingFast = true; controller.FallingBlock = new Block(displayMode, content, Vector2D.One); controller.UpcomingBlock = new Block(displayMode, content, Vector2D.One); Assert.AreEqual(0, CountBricks(grid)); AdvanceTimeAndUpdateEntities(2.5f); Assert.GreaterOrEqual(CountBricks(grid), 4); }
See Also