C# Класс GenerateGraph, cs-mini-modbot-simulation

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

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

Свойство Тип Описание
endNode Node,

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

Метод Описание
AddToDictionary ( Dictionary &dict, Node, key, Triangle, value ) : void

Given a dictionary that maps a Node to the list of Triangles that contain that Node on a side, add the value to the list of Triangles that the key currently maps to

GenerateGraph ( ) : System.Collections
GetPairString ( Vector3 v1, Vector3 v2 ) : string

Given two Vector3 objects, creates a string representation of that pair with the smaller Vector3 object coming first (ex: (1,2,3) and (4,5,6) will be respresented as "1,2,3 - 4,5,6" with the smaller Vector3 coming first)

Size ( ) : int
ToString ( ) : string

Returns a string representation of all the triangles of the nodes

ToStringWithNeighbors ( ) : string
addNodeNeighbor ( Node>.Dictionary sideToNode, Node, &givenNode, Vector3 first, Vector3 second, string laneName ) : void

Adds a neighbor to a given Node. The value of the neighbor is constructed from the sideToNode dictionary that is passed in; the dictionary requires a key specified by two Vector3 points and a laneName

getClosestNode ( Vector3 pos ) : Node,

Given a Vector3 pos, returns the Node in the list of Nodes that is closest to it.

getNodeWithVectorCoordinates ( Node>.Dictionary &coordinatesToNode, Vector3 givenVector ) : Node,

Returns the node that corresponds to the coordinates of the given Vector3. Checks for the node corresponding to the key constructured from the coordinates in the coordinatesToNode dictionary; if not in the dictionary, creates the node and adds it to the dictionary.

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

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

Given a dictionary that maps a Node to the list of Triangles that contain that Node on a side, add the value to the list of Triangles that the key currently maps to
public AddToDictionary ( Dictionary &dict, Node, key, Triangle, value ) : void
dict Dictionary // the dictionary that maps a Node to the list of Triangles that contain // that Node on a side //
key Node, a Node
value Triangle, a Triangle to add to the list of Triangles that the key currently maps to
Результат void

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

public GenerateGraph ( ) : System.Collections
Результат System.Collections

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

Given two Vector3 objects, creates a string representation of that pair with the smaller Vector3 object coming first (ex: (1,2,3) and (4,5,6) will be respresented as "1,2,3 - 4,5,6" with the smaller Vector3 coming first)
public GetPairString ( Vector3 v1, Vector3 v2 ) : string
v1 Vector3 the first given Vector3
v2 Vector3 the second given Vector3
Результат string

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

public Size ( ) : int
Результат int

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

Returns a string representation of all the triangles of the nodes
public ToString ( ) : string
Результат string

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

public ToStringWithNeighbors ( ) : string
Результат string

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

Adds a neighbor to a given Node. The value of the neighbor is constructed from the sideToNode dictionary that is passed in; the dictionary requires a key specified by two Vector3 points and a laneName
public addNodeNeighbor ( Node>.Dictionary sideToNode, Node, &givenNode, Vector3 first, Vector3 second, string laneName ) : void
sideToNode Node>.Dictionary // Maps a key specified by two Vector3 points (to specify a side) and a // laneName ("middle", "outer1", or "outer2") to a Node //
givenNode Node, a Node to add a neighbor to
first Vector3 the first Vector3 point
second Vector3 the second Vector3 point
laneName string the lane name ("middle", "outer1", or "outer2")
Результат void

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

Given a Vector3 pos, returns the Node in the list of Nodes that is closest to it.
public getClosestNode ( Vector3 pos ) : Node,
pos Vector3 a Vector3
Результат Node,

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

Returns the node that corresponds to the coordinates of the given Vector3. Checks for the node corresponding to the key constructured from the coordinates in the coordinatesToNode dictionary; if not in the dictionary, creates the node and adds it to the dictionary.
public getNodeWithVectorCoordinates ( Node>.Dictionary &coordinatesToNode, Vector3 givenVector ) : Node,
coordinatesToNode Node>.Dictionary // dictionary containing mappings from the coordinates of a Vector3 to the corresponding // node //
givenVector Vector3 a Vector3
Результат Node,

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

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

public Node, endNode
Результат Node,