C# 클래스 Bricklayer.Client.World.Map

상속: Bricklayer.Common.World.Map
파일 보기 프로젝트 열기: Cyral/Bricklayer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
tileSheet Microsoft.Xna.Framework.Graphics.Texture2D

공개 메소드들

메소드 설명
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)

비공개 메소드들

메소드 설명
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

메소드 상세

CanPlaceBlock() 공개 메소드

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
리턴 bool

CreateCamera() 공개 메소드

Creates a camera object at a set size
public CreateCamera ( ) : void
리턴 void

Draw() 공개 메소드

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

GetCollision() 공개 메소드

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
리턴 BlockCollision

GetTileBounds() 공개 메소드

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

Map() 공개 메소드

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
리턴 System

PlaceTile() 공개 메소드

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
리턴 void

SetMinimapColors() 공개 메소드

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

Update() 공개 메소드

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

UpdateTiles() 공개 메소드

Handles logic for updating tiles (Ex: animation)
public UpdateTiles ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

프로퍼티 상세

tileSheet 공개적으로 프로퍼티

public Texture2D,Microsoft.Xna.Framework.Graphics tileSheet
리턴 Microsoft.Xna.Framework.Graphics.Texture2D