C# Class Bricklayer.Client.World.Map

Inheritance: Bricklayer.Common.World.Map
Afficher le fichier Open project: Cyral/Bricklayer Class Usage Examples

Méthodes publiques

Свойство Type Description
tileSheet Microsoft.Xna.Framework.Graphics.Texture2D

Méthodes publiques

Méthode Description
CanPlaceBlock ( int x, int y, int z, BlockType block ) : bool

Determines if a player can place a block at a specified position

CreateCamera ( ) : void

Creates a camera object at a set size

Draw ( SpriteBatch spriteBatch, GameTime gameTime ) : void

Draws the map blocks an entities

GetCollision ( int x, int y ) : BlockCollision

Gets the collision mode of the tile at a particular location. This method handles tiles outside of the levels boundries by making it impossible to escape past the MainCamera.btnLeft or MainCamera.btnRight edges, but allowing things to jump beyond the MainCamera.Top of the level and fall off the MainCamera.bottom.

GetTileBounds ( int x, int y ) : Rectangle

Gets the bounding rectangle of a tile in world space.

Map ( Microsoft.Xna.Framework.Game game, int width, int height ) : System

Creates a client-side version of a map at the specified width and height (To be changed later once Init packet recieved)

PlaceTile ( int x, int y, Layer layer, BlockType block, bool sendMessage ) : void

Places a tile at the specified position, WHILE taking into account it's TileType Mainly used for player block placement, if you are looking to place a block through the code Either use `Tiles[x,y,z] =` or, set sendMessage to false

SetMinimapColors ( ) : void

Sets block's default colors from their image for use with the minimap

Update ( GameTime gameTime ) : void

Updates the map's entities and handles input

UpdateTiles ( GameTime gameTime ) : void

Handles logic for updating tiles (Ex: animation)

Private Methods

Méthode Description
DrawTiles ( SpriteBatch spriteBatch ) : void

Draws the foreground and background blocks of a map

HandleInput ( ) : void

Handles input for the level, such as clicking blocks and selecting them

LoadContent ( ) : void

Loads content needed for drawing on the client

Method Details

CanPlaceBlock() public méthode

Determines if a player can place a block at a specified position
public CanPlaceBlock ( int x, int y, int z, BlockType block ) : bool
x int
y int
z int
block BlockType
Résultat bool

CreateCamera() public méthode

Creates a camera object at a set size
public CreateCamera ( ) : void
Résultat void

Draw() public méthode

Draws the map blocks an entities
public Draw ( SpriteBatch spriteBatch, GameTime gameTime ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

GetCollision() public méthode

Gets the collision mode of the tile at a particular location. This method handles tiles outside of the levels boundries by making it impossible to escape past the MainCamera.btnLeft or MainCamera.btnRight edges, but allowing things to jump beyond the MainCamera.Top of the level and fall off the MainCamera.bottom.
public GetCollision ( int x, int y ) : BlockCollision
x int
y int
Résultat BlockCollision

GetTileBounds() public méthode

Gets the bounding rectangle of a tile in world space.
public GetTileBounds ( int x, int y ) : Rectangle
x int
y int
Résultat Microsoft.Xna.Framework.Rectangle

Map() public méthode

Creates a client-side version of a map at the specified width and height (To be changed later once Init packet recieved)
public Map ( Microsoft.Xna.Framework.Game game, int width, int height ) : System
game Microsoft.Xna.Framework.Game
width int
height int
Résultat System

PlaceTile() public méthode

Places a tile at the specified position, WHILE taking into account it's TileType Mainly used for player block placement, if you are looking to place a block through the code Either use `Tiles[x,y,z] =` or, set sendMessage to false
public PlaceTile ( int x, int y, Layer layer, BlockType block, bool sendMessage ) : void
x int The X position on the grid
y int The Y position on the grid
layer Layer The layer, either background or foreground
block BlockType The block to place
sendMessage bool Should the block be sent to the server or not
Résultat void

SetMinimapColors() public méthode

Sets block's default colors from their image for use with the minimap
public SetMinimapColors ( ) : void
Résultat void

Update() public méthode

Updates the map's entities and handles input
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

UpdateTiles() public méthode

Handles logic for updating tiles (Ex: animation)
public UpdateTiles ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

Property Details

tileSheet public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics tileSheet
Résultat Microsoft.Xna.Framework.Graphics.Texture2D