C# Class AStarCollisionMap.Collision.CollisionMap

Afficher le fichier Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Méthodes publiques

Свойство Type Description
collisionMapTextureScale int

Private Properties

Свойство Type Description
Init void

Méthodes publiques

Méthode Description
ClosestNodeInLOS ( Point p ) : AStarCollisionMap.Pathfinding.PathfindingNode

Gets the closest node in line of sight from the given point.

CollisionAt ( Point p ) : System.Boolean

Checks whether there is collision at a point.

CollisionAt ( int i ) : System.Boolean

Checks whether there is collision at an index.

CollisionMap ( Microsoft.Xna.Framework.Game game, int width, int height, String collisionMapPath, String collisionMapName, System.Boolean drawMode, int quadDepth ) : System
CollisionMap ( GraphicsDevice graphicsDevice, int width, int height, System.Boolean drawMode, int quadDepth ) : System
Dispose ( ) : void

Disposes of this collisionmap, releasing most resources used by the map.

FireCollisionChangedEvent ( CollisionChangedEvent e ) : void

Fires a collision changed event to all listeners.

GetNodeLocationsAroundEdges ( ) : CustomArrayList

Places nodes around all the edges

IndexExists ( Point p ) : System.Boolean
IndexExists ( int index ) : System.Boolean
IndexToPoint ( int index ) : Point

Converts an index to a point.

IsCollisionBetween ( Point p1, Point p2 ) : System.Boolean

Checks whether there is collision between two points.

LoadMap ( String path, String mapname ) : void

Loads a collision map from a file.

PixelsBetweenPoints ( Point p1, Point p2, int spacing ) : Point[]

Gets the pixels between points.

PointToIndex ( Point p ) : int
PointToIndex ( int x, int y ) : int

Returns the index of a certain point.

SaveToPng ( ) : void

Saves this collisionmap to a file.

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

Updates the collisionmap, without updating or adding pathfinding points. DO NOT USE THIS METHOD IN-GAME, ONLY IN THE EDITOR.

Private Methods

Méthode Description
Init ( int width, int height, String collisionMapPath, String collisionMapName, System.Boolean drawMode, int quadDepth ) : void

Method Details

ClosestNodeInLOS() public méthode

Gets the closest node in line of sight from the given point.
public ClosestNodeInLOS ( Point p ) : AStarCollisionMap.Pathfinding.PathfindingNode
p Point The point.
Résultat AStarCollisionMap.Pathfinding.PathfindingNode

CollisionAt() public méthode

Checks whether there is collision at a point.
public CollisionAt ( Point p ) : System.Boolean
p Point The point to check.
Résultat System.Boolean

CollisionAt() public méthode

Checks whether there is collision at an index.
public CollisionAt ( int i ) : System.Boolean
i int The index
Résultat System.Boolean

CollisionMap() public méthode

public CollisionMap ( Microsoft.Xna.Framework.Game game, int width, int height, String collisionMapPath, String collisionMapName, System.Boolean drawMode, int quadDepth ) : System
game Microsoft.Xna.Framework.Game
width int
height int
collisionMapPath String
collisionMapName String
drawMode System.Boolean
quadDepth int
Résultat System

CollisionMap() public méthode

public CollisionMap ( GraphicsDevice graphicsDevice, int width, int height, System.Boolean drawMode, int quadDepth ) : System
graphicsDevice GraphicsDevice
width int
height int
drawMode System.Boolean
quadDepth int
Résultat System

Dispose() public méthode

Disposes of this collisionmap, releasing most resources used by the map.
public Dispose ( ) : void
Résultat void

FireCollisionChangedEvent() public méthode

Fires a collision changed event to all listeners.
public FireCollisionChangedEvent ( CollisionChangedEvent e ) : void
e CollisionChangedEvent The event
Résultat void

GetNodeLocationsAroundEdges() public méthode

Places nodes around all the edges
public GetNodeLocationsAroundEdges ( ) : CustomArrayList
Résultat CustomArrayList

IndexExists() public méthode

public IndexExists ( Point p ) : System.Boolean
p Point
Résultat System.Boolean

IndexExists() public méthode

public IndexExists ( int index ) : System.Boolean
index int
Résultat System.Boolean

IndexToPoint() public méthode

Converts an index to a point.
public IndexToPoint ( int index ) : Point
index int The index.
Résultat Point

IsCollisionBetween() public méthode

Checks whether there is collision between two points.
public IsCollisionBetween ( Point p1, Point p2 ) : System.Boolean
p1 Point The first point.
p2 Point The second point.
Résultat System.Boolean

LoadMap() public méthode

Loads a collision map from a file.
public LoadMap ( String path, String mapname ) : void
path String The path of the map, WITHOUT a trailing slash.
mapname String The mapname.
Résultat void

PixelsBetweenPoints() public méthode

Gets the pixels between points.
public PixelsBetweenPoints ( Point p1, Point p2, int spacing ) : Point[]
p1 Point Point one
p2 Point Point two
spacing int The pixel spacing between the points (default should be 1). Lower than 1 will use 1.
Résultat Point[]

PointToIndex() public méthode

public PointToIndex ( Point p ) : int
p Point The point.
Résultat int

PointToIndex() public méthode

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

SaveToPng() public méthode

Saves this collisionmap to a file.
public SaveToPng ( ) : void
Résultat void

UpdateCollisionMap() public méthode

Updates the collisionmap, without updating or adding pathfinding points. DO NOT USE THIS METHOD IN-GAME, ONLY IN THE EDITOR.
public UpdateCollisionMap ( Rectangle rect, System.Boolean add ) : void
rect Microsoft.Xna.Framework.Rectangle The rectangle
add System.Boolean Whether to add or to remove the rect.
Résultat void

Property Details

collisionMapTextureScale public_oe property

public int collisionMapTextureScale
Résultat int