Show / Hide Table of Contents

Class DeadEndTrimmer

Implements an algorithm that will prune small dead-end locations (locations surrounded by 3 walls), from a map/list of map areas.

Inheritance
System.Object
DeadEndTrimmer
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: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public static class DeadEndTrimmer

Methods

| Improve this Doc View Source

Trim(ISettableMapView<Boolean>, IEnumerable<MapArea>, Int32, Int32, IGenerator)

Trims current small dead-end paths from the given list of map areas, and removes them from the given map.

Declaration
public static void Trim(ISettableMapView<bool> map, IEnumerable<MapArea> areas, int saveDeadEndChance = 100, int maxTrimIterations = -1, IGenerator rng = null)
Parameters
Type Name Description
ISettableMapView<System.Boolean> map

Map to remove-dead-end paths from.

System.Collections.Generic.IEnumerable<MapArea> areas

Map areas to check for dead ends. Dead ends not contained as one of these map areas will be ignored.

System.Int32 saveDeadEndChance

The chance out of 100 that a given dead end is left alone. Defaults to 0.

System.Int32 maxTrimIterations

Maximum number of passes to make looking for dead ends. Defaults to infinity.

Troschuetz.Random.IGenerator rng

Rng to use. Defaults to DefaultRNG.

| Improve this Doc View Source

Trim(ISettableMapView<Boolean>, Int32, Int32, IGenerator)

Trims current small dead-end paths from the given map.

Declaration
public static void Trim(ISettableMapView<bool> map, int saveDeadEndChance = 0, int maxTrimIterations = -1, IGenerator rng = null)
Parameters
Type Name Description
ISettableMapView<System.Boolean> map

Map to remove-dead-end paths from.

System.Int32 saveDeadEndChance

The chance out of 100 that a given dead end is left alone. Defaults to 0.

System.Int32 maxTrimIterations

Maximum number of passes to make looking for dead ends. Defaults to infinity.

Troschuetz.Random.IGenerator rng

Rng to use. Defaults to DefaultRNG.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX