C# Класс AStarCollisionMap.Collision.CollisionMap

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
collisionMapTextureScale int

Private Properties

Свойство Тип Описание
Init void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
Init ( int width, int height, String collisionMapPath, String collisionMapName, System.Boolean drawMode, int quadDepth ) : void

Описание методов

ClosestNodeInLOS() публичный Метод

Gets the closest node in line of sight from the given point.
public ClosestNodeInLOS ( Point p ) : AStarCollisionMap.Pathfinding.PathfindingNode
p Point The point.
Результат AStarCollisionMap.Pathfinding.PathfindingNode

CollisionAt() публичный Метод

Checks whether there is collision at a point.
public CollisionAt ( Point p ) : System.Boolean
p Point The point to check.
Результат System.Boolean

CollisionAt() публичный Метод

Checks whether there is collision at an index.
public CollisionAt ( int i ) : System.Boolean
i int The index
Результат System.Boolean

CollisionMap() публичный Метод

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
Результат System

CollisionMap() публичный Метод

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
Результат System

Dispose() публичный Метод

Disposes of this collisionmap, releasing most resources used by the map.
public Dispose ( ) : void
Результат void

FireCollisionChangedEvent() публичный Метод

Fires a collision changed event to all listeners.
public FireCollisionChangedEvent ( CollisionChangedEvent e ) : void
e CollisionChangedEvent The event
Результат void

GetNodeLocationsAroundEdges() публичный Метод

Places nodes around all the edges
public GetNodeLocationsAroundEdges ( ) : CustomArrayList
Результат CustomArrayList

IndexExists() публичный Метод

public IndexExists ( Point p ) : System.Boolean
p Point
Результат System.Boolean

IndexExists() публичный Метод

public IndexExists ( int index ) : System.Boolean
index int
Результат System.Boolean

IndexToPoint() публичный Метод

Converts an index to a point.
public IndexToPoint ( int index ) : Point
index int The index.
Результат Point

IsCollisionBetween() публичный Метод

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.
Результат System.Boolean

LoadMap() публичный Метод

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.
Результат void

PixelsBetweenPoints() публичный Метод

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.
Результат Point[]

PointToIndex() публичный Метод

public PointToIndex ( Point p ) : int
p Point The point.
Результат int

PointToIndex() публичный Метод

Returns the index of a certain point.
public PointToIndex ( int x, int y ) : int
x int
y int
Результат int

SaveToPng() публичный Метод

Saves this collisionmap to a file.
public SaveToPng ( ) : void
Результат void

UpdateCollisionMap() публичный Метод

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.
Результат void

Описание свойств

collisionMapTextureScale публичное свойство

public int collisionMapTextureScale
Результат int