C# Class Platformer.Tiles.WaterDrain

A water drain is a sink that pulls water from an area. Any change of state invoked by the IActivatable interface will always lower the water level.
Inheritance: Tile, IActivatable
Mostra file Open project: zmthy/play-dead

Public Methods

Method Description
ChangeState ( ) : void
IsActive ( ) : bool
SetState ( bool active ) : void
Update ( GameTime gameTime ) : void
WaterDrain ( Sprite sprite ) : System

Creates a new water drain.

bindToLevel ( Level level ) : void

Assigns the level the water drain belongs to.

decreaseWaterLevel ( ) : void

Decrease the water level by one (tile).

Private Methods

Method Description
drainRow ( int x, int y, bool lookLeft ) : void

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

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

WaterDrain() public method

Creates a new water drain.
public WaterDrain ( Sprite sprite ) : System
sprite Sprite The look and position of the water drain.
return System

bindToLevel() public method

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

decreaseWaterLevel() public method

Decrease the water level by one (tile).
public decreaseWaterLevel ( ) : void
return void