C# Class CastleEscape.ScriptableMap

A map that has an associated script. Author: Dennis Honeyman
Datei anzeigen Open project: Daminvar/CastleEscape Class Usage Examples

Protected Properties

Property Type Description
NPEs List
game Microsoft.Xna.Framework.Game
scriptLock object
tmxMap TMXMap

Public Methods

Method Description
ChangeMap ( Directions direction ) : bool

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

GetNPEAt ( int x, int y ) : NPE

Returns the NPE at the specified location

GetRandomEncounter ( ) : Enemy
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.

ReloadMap ( ) : void

Reloads the current map.

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

Private Methods

Method Description
createItemArray ( ArrayList itemArrayList ) : Item[]
js_addNPE ( NPE newNPE ) : void
js_addRandomEncounter ( Enemy enemy ) : void
js_battle ( Player player, Enemy enemy, string song ) : void
js_dialogue ( string text ) : void
js_getFlag ( string flag ) : bool
js_newEnemy ( string textureName, string enemyName, double health, double attack, double defense, double speed, double exp, ArrayList items ) : Enemy
js_newItem ( string itemName, string description, double healthBonus, double manaBonus, double cost ) : Item
js_newNPE ( ) : NPE
js_overworldMusic ( string song ) : void
js_randomBattleMusic ( string song ) : void
js_save ( Player player ) : void
js_setBattleTexture ( string textureName ) : void
js_setEastMapfile ( string filename ) : void
js_setFlag ( string flag ) : void
js_setMapName ( string name ) : void
js_setNorthMapfile ( string filename ) : void
js_setSouthMapfile ( string filename ) : void
js_setTmxMapfile ( string filename ) : void
js_setWestMapfile ( string filename ) : void
js_store ( Player player, ArrayList itemsArrayList ) : void
js_win ( ) : void
loadMapAndScript ( string filename ) : void
parseScriptFile ( 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 ) : bool
direction Directions The direction to use
return bool

GetNPEAt() public method

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

GetRandomEncounter() public method

public GetRandomEncounter ( ) : Enemy
return Enemy

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

ReloadMap() public method

Reloads the current map.
public ReloadMap ( ) : void
return void

ScriptableMap() public method

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

Property Details

NPEs protected_oe property

protected List NPEs
return List

game protected_oe property

protected Game,Microsoft.Xna.Framework game
return Microsoft.Xna.Framework.Game

scriptLock protected_oe property

protected object scriptLock
return object

tmxMap protected_oe property

protected TMXMap,CastleEscape tmxMap
return TMXMap