Maze Factory  1.0
Unity3d component package for procedural mazes
 All Classes Functions Variables Enumerations Properties
MFCell Class Reference

A maze is built out of cells. Each cell is built out of 4 boundaries where a nine patch can be derived from. More...

List of all members.

Public Types

enum  Paths {
  Up, Down, Right, Left,
  None
}
 Paths. More...

Public Member Functions

 MFCell (MFPosition position)
 Initializes a new instance of the MFCell class.
void Reset ()
 Reset a cell so that all walls are intact and not visited
bool[] AsNinepatch ()
 Derive a ninepatch from the current cell setup.

Public Attributes

bool leftWall
 The left wall.
bool rightWall
 The right wall.
bool upWall
 Up wall.
bool downWall
 Down wall.
bool visited
 visited: used by search algorithm.
Paths Path
 The direction in the path it has.
MFCell Previous
 Gets or sets a reference to the previous MFCell in the found path chain
Vector3 localPosition
 Convenience field to store the position in local space.
List< Vector3 > localNinePatchPositions
 Convenience field to store the positions of each element of the ninepatch in local space.

Properties

bool this[int index] [get, set]
 Provides indexing to the boolean fields in the cell
MFPosition Position [get]
 The current location on the two-dimensional container

Detailed Description

A maze is built out of cells. Each cell is built out of 4 boundaries where a nine patch can be derived from.

Exceptions:
ArgumentOutOfRangeExceptionIs thrown when the argument out of range exception.

Member Enumeration Documentation

enum Paths

Paths.


Constructor & Destructor Documentation

MFCell ( MFPosition  position)

Initializes a new instance of the MFCell class.

Parameters:
positionPosition.

Member Function Documentation

bool [] AsNinepatch ( )

Derive a ninepatch from the current cell setup.

Returns:
The ninepatch as an array of bool. If true then there's a block, if not it's walkable and there is no block.
void Reset ( )

Reset a cell so that all walls are intact and not visited


Member Data Documentation

bool downWall

Down wall.

bool leftWall

The left wall.

List<Vector3> localNinePatchPositions

Convenience field to store the positions of each element of the ninepatch in local space.

Vector3 localPosition

Convenience field to store the position in local space.

Paths Path

The direction in the path it has.

MFCell Previous

Gets or sets a reference to the previous MFCell in the found path chain

bool rightWall

The right wall.

bool upWall

Up wall.

bool visited

visited: used by search algorithm.


Property Documentation

MFPosition Position
get

The current location on the two-dimensional container

bool this[int index]
getset

Provides indexing to the boolean fields in the cell

Parameters:
index0 leftW, 1 rightW, 2 UpW, 3 downW, 4 visited
Returns:

The documentation for this class was generated from the following file: