C# Class Platformer.Tiles.WaterSource

A water source is a tap that pushes water into an area. Any change of state invoked by the IActivatable interface will always raise the water level.
Inheritance: Tile, IActivatable
Afficher le fichier Open project: zmthy/play-dead

Méthodes publiques

Méthode Description
ChangeState ( ) : void
IsActive ( ) : bool
SetState ( bool active ) : void
Update ( GameTime gameTime ) : void
WaterSource ( Sprite emptySprite, Sprite fullSprite ) : System

Creates a new water source.

bindToLevel ( Level level ) : void

Assigns the level the water source belongs to.

increaseWaterLevel ( ) : void

Increase the water level by one (tile).

Private Methods

Méthode Description
fillRow ( int x, int y, bool lookLeft ) : List

Fills a row of tiles, turing all Passable tiles into Water tiles. The process stops when the first non-Passable tile is found.

propogate ( List waterTiles ) : void

Propogates water tiles by filling adjacent Passable tiles with water. For all provided water tiles, if a Passable tile is found below, to the right, or to the left, that tile will be made Water and will be propogated.

Method Details

ChangeState() public méthode

public ChangeState ( ) : void
Résultat void

IsActive() public méthode

public IsActive ( ) : bool
Résultat bool

SetState() public méthode

public SetState ( bool active ) : void
active bool
Résultat void

Update() public méthode

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

WaterSource() public méthode

Creates a new water source.
public WaterSource ( Sprite emptySprite, Sprite fullSprite ) : System
emptySprite Sprite Sprite to indicate a non-water background.
fullSprite Sprite prite to indicate a water background.
Résultat System

bindToLevel() public méthode

Assigns the level the water source belongs to.
public bindToLevel ( Level level ) : void
level Platformer.Levels.Level Housing level.
Résultat void

increaseWaterLevel() public méthode

Increase the water level by one (tile).
public increaseWaterLevel ( ) : void
Résultat void