Show / Hide Table of Contents

Class ItemList<TItem>

A generic list of items added by map generation steps, that tracks what generation step added what item.

Inheritance
object
ItemList<TItem>
Implements
IEnumerable<ItemStepPair<TItem>>
IEnumerable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.MapGeneration.ContextComponents
Assembly: GoRogue.dll
Syntax
[DataContract]
public class ItemList<TItem> : IEnumerable<ItemStepPair<TItem>>, IEnumerable where TItem : notnull
Type Parameters
Name Description
TItem

Type of item being stored.

Constructors

View Source

ItemList()

Creates an empty item list.

Declaration
public ItemList()
View Source

ItemList(IEnumerable<ItemStepPair<TItem>>)

Creates a new item list and adds the given items to it.

Declaration
public ItemList(IEnumerable<ItemStepPair<TItem>> initialItems)
Parameters
Type Name Description
IEnumerable<ItemStepPair<TItem>> initialItems

Initial item/step pairs to add to the list.

View Source

ItemList(int)

Creates an empty item list with the specified initial capacity for items.

Declaration
public ItemList(int initialItemCapacity)
Parameters
Type Name Description
int initialItemCapacity

Properties

View Source

ItemToStepMapping

A mapping of each item to the Name of the generation step that created the item.

Declaration
public IReadOnlyDictionary<TItem, string> ItemToStepMapping { get; }
Property Value
Type Description
IReadOnlyDictionary<TItem, string>
View Source

Items

The list of items added.

Declaration
public IReadOnlyList<TItem> Items { get; }
Property Value
Type Description
IReadOnlyList<TItem>

Methods

View Source

Add(TItem, string)

Adds an item to to the list.

Declaration
public void Add(TItem item, string generationStepName)
Parameters
Type Name Description
TItem item

The item to add.

string generationStepName

The Name of the generation step that created the item.

View Source

AddRange(IEnumerable<TItem>, string)

Adds the given items to the list.

Declaration
public void AddRange(IEnumerable<TItem> items, string generationStepName)
Parameters
Type Name Description
IEnumerable<TItem> items

The items to add.

string generationStepName

The Name of the generation step that created the items.

View Source

GetEnumerator()

Gets an enumerator of all items and the step that added them.

Declaration
public IEnumerator<ItemStepPair<TItem>> GetEnumerator()
Returns
Type Description
IEnumerator<ItemStepPair<TItem>>
View Source

Remove(IEnumerable<TItem>)

Removes the given items from the list.

Declaration
public void Remove(IEnumerable<TItem> items)
Parameters
Type Name Description
IEnumerable<TItem> items

Items to remove.

View Source

Remove(Func<TItem, bool>)

Removes all items from the list for which the given function returns true.

Declaration
public void Remove(Func<TItem, bool> predicate)
Parameters
Type Name Description
Func<TItem, bool> predicate

Predicate to determine which elements to remove.

View Source

Remove(TItem)

Removes the given item from the list.

Declaration
public void Remove(TItem item)
Parameters
Type Name Description
TItem item

Item to remove.

Implements

IEnumerable<T>
IEnumerable

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX