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
显示文件 Open project: zmthy/play-dead

Public Methods

Method 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

Method 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 method

public ChangeState ( ) : void
return void

IsActive() public method

public IsActive ( ) : bool
return bool

SetState() public method

public SetState ( bool active ) : void
active bool
return void

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

WaterSource() public method

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.
return System

bindToLevel() public method

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

increaseWaterLevel() public method

Increase the water level by one (tile).
public increaseWaterLevel ( ) : void
return void