C# Class GenerateGraph, cs-mini-modbot-simulation

Inheritance: MonoBehaviour
Exibir arquivo Open project: intel-cornellcup/mini-modbot-simulation Class Usage Examples

Public Properties

Property Type Description
endNode Node,

Public Methods

Method Description
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.

Method Details

AddToDictionary() public method

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
return void

GenerateGraph() public method

public GenerateGraph ( ) : System.Collections
return System.Collections

GetPairString() public method

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
return string

Size() public method

public Size ( ) : int
return int

ToString() public method

Returns a string representation of all the triangles of the nodes
public ToString ( ) : string
return string

ToStringWithNeighbors() public method

public ToStringWithNeighbors ( ) : string
return string

addNodeNeighbor() public method

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")
return void

getClosestNode() public method

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
return Node,

getNodeWithVectorCoordinates() public method

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
return Node,

Property Details

endNode public_oe property

public Node, endNode
return Node,