C# Class Gruppe22.Client.Mainmap

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

Méthodes publiques

Méthode 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

Méthode 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 méthode

public AddProjectile ( Backend coords, Backend dir, ProjectileTile tile ) : uint
coords Backend
dir Backend
tile ProjectileTile
Résultat uint

DisplaySubtitle() public méthode

public DisplaySubtitle ( string main = "", string sub = "" ) : void
main string
sub string
Résultat void

Draw() public méthode

Draw the Map
public Draw ( GameTime gametime ) : void
gametime Microsoft.Xna.Framework.GameTime
Résultat void

FireProjectile() public méthode

public FireProjectile ( ) : void
Résultat void

GetProjectile() public méthode

public GetProjectile ( uint id ) : Projectile
id uint
Résultat Projectile

GetWallStyle() public méthode

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
Résultat WallDir

HandleEvent() public méthode

public HandleEvent ( bool DownStream, Backend eventID ) : void
DownStream bool
eventID Backend
Résultat void

IsMoving() public méthode

public IsMoving ( int id ) : bool
id int
Résultat bool

Mainmap() public méthode

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
Résultat System

MoveContent() public méthode

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

RemoveProjectile() public méthode

public RemoveProjectile ( uint id ) : void
id uint
Résultat void

Update() public méthode

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

_map2screen() public static méthode

public static _map2screen ( Backend mapC, bool tall = false ) : Backend.Coords
mapC Backend
tall bool
Résultat Backend.Coords

_map2screen() public static méthode

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

_pos2Tile() public static méthode

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

_screen2map() public static méthode

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

_screen2map() public static méthode

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
Résultat Backend.Coords

_tileRect() public static méthode

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

addEffect() public méthode

public addEffect ( int animationID, Backend pos ) : void
animationID int
pos Backend
Résultat void

floatNumber() public méthode

public floatNumber ( Backend tile, string text, Color color ) : void
tile Backend
text string
color Color
Résultat void

resetActors() public méthode

public resetActors ( ) : void
Résultat void