C# Class ByChance.Levels2D.Context2D

Describes a position a chunk can be aligned at to another one in a 2D level.
Inheritance: ByChance.Core.Context
Show file Open project: npruehs/bychance Class Usage Examples

Public Methods

Method Description
IsAdjacentTo ( Context other, float offset ) : bool

Checks whether this context is within offset to other in terms of the Euclidean norm.

ToString ( ) : string

Returns the absolute position of this context within the level as string.

Private Methods

Method Description
Context2D ( Context2D template, Chunk source ) : System

Constructs a new context with the same index and relative position as the passed one and attaches it to the specified chunk.

Context2D ( Vector2F relativePosition ) : System

Constructs a new context with the passed position relative to the position of the chunk it belongs to.

Context2D ( Vector2F relativePosition, string tag ) : System

Constructs a new context of the specified category and with the passed position relative to the position of the chunk it belongs to.

Method Details

IsAdjacentTo() public method

Checks whether this context is within offset to other in terms of the Euclidean norm.
Context to check the adjacency to is null. Context to check the adjacency to is not of type .
public IsAdjacentTo ( Context other, float offset ) : bool
other ByChance.Core.Context Context to check the adjacency to.
offset float Offset within this context is considered to be adjacent to .
return bool

ToString() public method

Returns the absolute position of this context within the level as string.
public ToString ( ) : string
return string