C# Class CastleEscape.Map

Represents a map in the game. Author: Dennis Honeyman
Show file Open project: Daminvar/CastleEscape

Public Methods

Method Description
ChangeMap ( Directions direction ) : void

Changes the map by loading the correct map file for the specified direction.

DrawBase ( SpriteBatch spriteBatch, int xPos, int yPos ) : void

Renders the base of the map (everything below the player) at the specified coordinates.

DrawTop ( SpriteBatch spriteBatch, int xPos, int yPos ) : void

Renders the top of the map (everything above the player) at the specified coordinates.

GetNPEAt ( int x, int y ) : NPE

Returns the NPE at the specified location

IsCollisionAt ( int x, int y ) : bool

Tests to see if there is a collision at the specified coordinates.

LoadMap ( string filename ) : void

Loads a map from a file.

Map ( Microsoft.Xna.Framework.Game game ) : System

Private Methods

Method Description
addNPE ( NPE newNPE ) : void
dialogue ( string text ) : void
drawLayers ( List layers, SpriteBatch spriteBatch, int xPos, int yPos ) : void
drawNPEs ( SpriteBatch spriteBatch, int xPos, int yPos ) : void
getFlag ( string flag ) : bool
newNPE ( ) : NPE
parseLayer ( XmlNode layerData ) : int[][]
parseScriptFile ( string filename ) : void
parseTMXFile ( ) : void
save ( Player player ) : void
setEastMapfile ( string filename ) : void
setFlag ( string flag ) : void
setMapName ( string name ) : void
setNorthMapfile ( string filename ) : void
setSouthMapfile ( string filename ) : void
setTmxMapfile ( string filename ) : void
setWestMapfile ( string filename ) : void

Method Details

ChangeMap() public method

Changes the map by loading the correct map file for the specified direction.
public ChangeMap ( Directions direction ) : void
direction Directions The direction to use
return void

DrawBase() public method

Renders the base of the map (everything below the player) at the specified coordinates.
public DrawBase ( SpriteBatch spriteBatch, int xPos, int yPos ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
xPos int
yPos int
return void

DrawTop() public method

Renders the top of the map (everything above the player) at the specified coordinates.
public DrawTop ( SpriteBatch spriteBatch, int xPos, int yPos ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
xPos int
yPos int
return void

GetNPEAt() public method

Returns the NPE at the specified location
public GetNPEAt ( int x, int y ) : NPE
x int
y int
return NPE

IsCollisionAt() public method

Tests to see if there is a collision at the specified coordinates.
public IsCollisionAt ( int x, int y ) : bool
x int
y int
return bool

LoadMap() public method

Loads a map from a file.
public LoadMap ( string filename ) : void
filename string The filename
return void

Map() public method

public Map ( Microsoft.Xna.Framework.Game game ) : System
game Microsoft.Xna.Framework.Game
return System