C# Class AStarCollisionMap.QuadTree.CollisionTexture

Show file Open project: Wotuu/RTS_XNA_v2

Private Properties

Property Type Description
UpdateTexture void

Public Methods

Method Description
CollisionAt ( int i ) : System.Boolean

Checks whether there is collision at a certain point.

CollisionTexture ( Quad quad, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
PointToIndex ( int x, int y ) : int

Returns the index of a certain point.

SetCollisionAt ( int i, System.Boolean value ) : void

Sets collision data at this point.

TextureToBoolean ( ) : System.Boolean[]

Converts a texture to a boolean array

UpdateCollision ( Rectangle rect, System.Boolean add ) : void

Updates the collision of this texture, and update the texture as well.

Private Methods

Method Description
UpdateTexture ( ) : void

Updates the texture of this collisiontexture.

Method Details

CollisionAt() public method

Checks whether there is collision at a certain point.
public CollisionAt ( int i ) : System.Boolean
i int The index of the point to check at. Note that the index has to fall within /// the bounds of this texture, i.e., it's only as large as this.rectangle.Width * this.rectangle.Height.
return System.Boolean

CollisionTexture() public method

public CollisionTexture ( Quad quad, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : System
quad Quad
texture Microsoft.Xna.Framework.Graphics.Texture2D
return System

PointToIndex() public method

Returns the index of a certain point.
public PointToIndex ( int x, int y ) : int
x int
y int
return int

SetCollisionAt() public method

Sets collision data at this point.
public SetCollisionAt ( int i, System.Boolean value ) : void
i int The point to put it at.
value System.Boolean The value to place it at.
return void

TextureToBoolean() public method

Converts a texture to a boolean array
public TextureToBoolean ( ) : System.Boolean[]
return System.Boolean[]

UpdateCollision() public method

Updates the collision of this texture, and update the texture as well.
public UpdateCollision ( Rectangle rect, System.Boolean add ) : void
rect Microsoft.Xna.Framework.Rectangle The rectangle that is to be updated.
add System.Boolean Whether to add or remove the rectangle.
return void