C# Class PathfindingTest.Collision.RTSCollisionMap

Inheritance: AStarCollisionMap.Collision.CollisionMap
显示文件 Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Public Methods

Method Description
CanPlace ( Rectangle rect ) : System.Boolean

Checks whether you can place the rectangle on the map. You can of course still update the collision map despite the outcome of this function.

DrawMap ( SpriteBatch sb ) : void

Draws this map on the screen.

PlaceBuilding ( Rectangle rect ) : BuildingMesh

Updates the collisionmap, adding the rectangle to the collisionmap, and performing new connections, as for placing nodes

PlaceNodesAroundEdges ( ) : void

Places nodes around collision edges

RTSCollisionMap ( Microsoft.Xna.Framework.Game game, int width, int height, String collisionMapPath, String collisionMapName ) : System
RTSCollisionMap ( GraphicsDevice device, int width, int height, int quadDepth ) : System

Method Details

CanPlace() public method

Checks whether you can place the rectangle on the map. You can of course still update the collision map despite the outcome of this function.
public CanPlace ( Rectangle rect ) : System.Boolean
rect Microsoft.Xna.Framework.Rectangle The rect you want to update
return System.Boolean

DrawMap() public method

Draws this map on the screen.
public DrawMap ( SpriteBatch sb ) : void
sb Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

PlaceBuilding() public method

Updates the collisionmap, adding the rectangle to the collisionmap, and performing new connections, as for placing nodes
public PlaceBuilding ( Rectangle rect ) : BuildingMesh
rect Microsoft.Xna.Framework.Rectangle
return BuildingMesh

PlaceNodesAroundEdges() public method

Places nodes around collision edges
public PlaceNodesAroundEdges ( ) : void
return void

RTSCollisionMap() public method

public RTSCollisionMap ( Microsoft.Xna.Framework.Game game, int width, int height, String collisionMapPath, String collisionMapName ) : System
game Microsoft.Xna.Framework.Game
width int
height int
collisionMapPath String
collisionMapName String
return System

RTSCollisionMap() public method

public RTSCollisionMap ( GraphicsDevice device, int width, int height, int quadDepth ) : System
device GraphicsDevice
width int
height int
quadDepth int
return System