RogueSharp
Show / Hide Table of Contents

Class Path

A class representing an ordered list of Cells from Start to End The path can be traversed by the StepForward and StepBackward methods Implemented by a doubly linked list

Inheritance
System.Object
Path
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: RogueSharp
Assembly: RogueSharp.dll
Syntax
public class Path

Constructors

| Improve this Doc View Source

Path(IEnumerable<ICell>)

Construct a new Path from the specified ordered list of Cells

Declaration
public Path(IEnumerable<ICell> steps)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ICell> steps

An IEnumerable of Cells that represent the ordered steps along this Path from Start to End

Exceptions
Type Condition
System.ArgumentNullException

Thrown when the specified steps parameter is null

System.ArgumentException

Thrown when the specified steps parameter is empty

Properties

| Improve this Doc View Source

CurrentStep

The Cell representing the step that is currently occupied in this Path

Declaration
public ICell CurrentStep { get; }
Property Value
Type Description
ICell
| Improve this Doc View Source

End

The Cell representing the last step or End of this Path

Declaration
public ICell End { get; }
Property Value
Type Description
ICell
| Improve this Doc View Source

Length

The number of steps in this Path

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Start

The Cell representing the first step or Start of this Path

Declaration
public ICell Start { get; }
Property Value
Type Description
ICell
| Improve this Doc View Source

Steps

All of the Cells representing the Steps in this Path from Start to End as an IEnumerable

Declaration
public IEnumerable<ICell> Steps { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ICell>

Methods

| Improve this Doc View Source

StepBackward()

Move backwards along this Path and rewind the CurrentStep to the previous Step in the Path

Declaration
public ICell StepBackward()
Returns
Type Description
ICell

A Cell representing the Step that was moved to as we back up along the Path

Exceptions
Type Condition
NoMoreStepsException

Thrown when attempting to move backward along a Path on which we are currently at the Start

| Improve this Doc View Source

StepForward()

Move forward along this Path and advance the CurrentStep to the next Step in the Path

Declaration
public ICell StepForward()
Returns
Type Description
ICell

A Cell representing the Step that was moved to as we advanced along the Path

Exceptions
Type Condition
NoMoreStepsException

Thrown when attempting to move forward along a Path on which we are currently at the End

| Improve this Doc View Source

TryStepBackward()

Move backwards along this Path and rewind the CurrentStep to the next Step in the Path

Declaration
public ICell TryStepBackward()
Returns
Type Description
ICell

A Cell representing the Step that was moved to as we back up along the Path. If there is not another Cell in the path to back up to null is returned

| Improve this Doc View Source

TryStepForward()

Move forward along this Path and advance the CurrentStep to the next Step in the Path

Declaration
public ICell TryStepForward()
Returns
Type Description
ICell

A Cell representing the Step that was moved to as we advanced along the Path. If there is not another Cell in the path to advance to null is returned

  • Improve this Doc
  • View Source
RogueSharp © 2014-2020 Faron Bracy
Back to top