C# Class Gruppe22.Client.Mainmap

The core display of the current part of the dungeon
Inheritance: Zoomable
Show file Open project: propra13-orga/gruppe22 Class Usage Examples

Public Methods

Method Description
AddProjectile ( Backend coords, Backend dir, ProjectileTile tile ) : uint
DisplaySubtitle ( string main = "", string sub = "" ) : void
Draw ( GameTime gametime ) : void

Draw the Map

FireProjectile ( ) : void
GetProjectile ( uint id ) : Projectile
GetWallStyle ( int x, int y, bool CheckWall = true, int FloorStyle = -1 ) : WallDir

Determine wall style to use depending on surrounding squares

HandleEvent ( bool DownStream, Backend eventID ) : void
IsMoving ( int id ) : bool
Mainmap ( Backend parent, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Content.ContentManager content, Rectangle displayArea, Backend map, bool enabled = true ) : System

Create the visible version of the game map

MoveContent ( Vector2 difference, int _lastCheck ) : void

Disable moving map by mouse drag to avoid conflicts with move by click

RemoveProjectile ( uint id ) : void
Update ( GameTime gameTime ) : void

Move camera, react to mouse

_map2screen ( Backend mapC, bool tall = false ) : Backend.Coords

_map2screen ( int x, int y, bool tall = false ) : Backend.Coords

_pos2Tile ( Vector2 coords, bool tall = false ) : Backend.Coords

Determine tile based on coordinates of point

_screen2map ( Backend screenC, bool tall = false ) : Backend.Coords

Determine tile based on coordinates of point

_screen2map ( int x, int y, bool tall = false ) : Backend.Coords

Determine tile based on coordinates of point

_tileRect ( Vector2 coords, bool tall = false ) : Rectangle

addEffect ( int animationID, Backend pos ) : void
floatNumber ( Backend tile, string text, Color color ) : void
resetActors ( ) : void

Private Methods

Method Description
_UpdateMouse ( Vector2 coords ) : void

Highlight tile based on mouse position; note inverted matrix (since map is zoomed / panned)

_drawFloor ( ) : void

Display the floor (using "rugged edges" to hide isometric-pattern)

_drawWall ( WallDir dir, Rectangle target, bool transparent, bool active, Backend special = Backend.WallType.Normal ) : void

Display a wall

_drawWalls ( GameTime gametime ) : void

Display all walls on the current map

Method Details

AddProjectile() public method

public AddProjectile ( Backend coords, Backend dir, ProjectileTile tile ) : uint
coords Backend
dir Backend
tile ProjectileTile
return uint

DisplaySubtitle() public method

public DisplaySubtitle ( string main = "", string sub = "" ) : void
main string
sub string
return void

Draw() public method

Draw the Map
public Draw ( GameTime gametime ) : void
gametime Microsoft.Xna.Framework.GameTime
return void

FireProjectile() public method

public FireProjectile ( ) : void
return void

GetProjectile() public method

public GetProjectile ( uint id ) : Projectile
id uint
return Projectile

GetWallStyle() public method

Determine wall style to use depending on surrounding squares
public GetWallStyle ( int x, int y, bool CheckWall = true, int FloorStyle = -1 ) : WallDir
x int horizontal coordinate of square to check
y int vertical coordinate of square to check
CheckWall bool
FloorStyle int
return WallDir

HandleEvent() public method

public HandleEvent ( bool DownStream, Backend eventID ) : void
DownStream bool
eventID Backend
return void

IsMoving() public method

public IsMoving ( int id ) : bool
id int
return bool

Mainmap() public method

Create the visible version of the game map
public Mainmap ( Backend parent, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Content.ContentManager content, Rectangle displayArea, Backend map, bool enabled = true ) : System
parent Backend
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A sprite batch used for drawing
content Microsoft.Xna.Framework.Content.ContentManager
displayArea Microsoft.Xna.Framework.Rectangle The area on wich the map will be placed
map Backend Internal storage of map data
enabled bool
return System

MoveContent() public method

Disable moving map by mouse drag to avoid conflicts with move by click
public MoveContent ( Vector2 difference, int _lastCheck ) : void
difference Vector2
_lastCheck int
return void

RemoveProjectile() public method

public RemoveProjectile ( uint id ) : void
id uint
return void

Update() public method

Move camera, react to mouse
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

_map2screen() public static method

public static _map2screen ( Backend mapC, bool tall = false ) : Backend.Coords
mapC Backend
tall bool
return Backend.Coords

_map2screen() public static method

public static _map2screen ( int x, int y, bool tall = false ) : Backend.Coords
x int
y int
tall bool
return Backend.Coords

_pos2Tile() public static method

Determine tile based on coordinates of point
public static _pos2Tile ( Vector2 coords, bool tall = false ) : Backend.Coords
coords Vector2
tall bool
return Backend.Coords

_screen2map() public static method

Determine tile based on coordinates of point
public static _screen2map ( Backend screenC, bool tall = false ) : Backend.Coords
screenC Backend
tall bool
return Backend.Coords

_screen2map() public static method

Determine tile based on coordinates of point
public static _screen2map ( int x, int y, bool tall = false ) : Backend.Coords
x int
y int
tall bool
return Backend.Coords

_tileRect() public static method

public static _tileRect ( Vector2 coords, bool tall = false ) : Rectangle
coords Vector2
tall bool
return Microsoft.Xna.Framework.Rectangle

addEffect() public method

public addEffect ( int animationID, Backend pos ) : void
animationID int
pos Backend
return void

floatNumber() public method

public floatNumber ( Backend tile, string text, Color color ) : void
tile Backend
text string
color Color
return void

resetActors() public method

public resetActors ( ) : void
return void