Class CellDecoratorHelpers
Helpers for CellDecorator and Decorators which manages null on the property.
Inherited Members
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
public static class CellDecoratorHelpers
Properties
Pool
The list pool used for creating the decorator lists applied to cells.
Declaration
public static IListPool<CellDecorator> Pool { get; set; }
Property Value
Type | Description |
---|---|
IListPool<CellDecorator> |
Methods
AddDecorator(CellDecorator, ColoredGlyphBase)
Adds the specified decorator to a glyph.
Declaration
public static void AddDecorator(CellDecorator decorator, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
CellDecorator | decorator | The decorator to add. |
ColoredGlyphBase | glyph | The glyph to alter. |
AddDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)
Adds the decorators to a glyph.
Declaration
public static void AddDecorators(IEnumerable<CellDecorator>? decorators, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CellDecorator> | decorators | The decorators to add. Duplicates are skipped. |
ColoredGlyphBase | glyph | The glyph to alter. |
CloneDecorators(ColoredGlyphBase)
Returns a new list of decorators from the Decorators property of glyph
.
Declaration
public static List<CellDecorator>? CloneDecorators(ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
ColoredGlyphBase | glyph | The glyph to copy the decorators from. |
Returns
Type | Description |
---|---|
List<CellDecorator> | A list with all of the decorators from |
ItemsMatch(List<CellDecorator>?, List<CellDecorator>?)
Determines whether the contents of two CellDecorator arrays are equal.
Declaration
public static bool ItemsMatch(this List<CellDecorator>? self, List<CellDecorator>? other)
Parameters
Type | Name | Description |
---|---|---|
List<CellDecorator> | self | The first object to compare. |
List<CellDecorator> | other | The second object to compare. |
Returns
Type | Description |
---|---|
bool | A boolean value to indicate whether or not the two arrays are considered equal. |
RemoveAllDecorators(ColoredGlyphBase)
Removes all decorators from a glyph, returns the list to the pool, and sets the Decorators collection to null.
Declaration
public static void RemoveAllDecorators(ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
ColoredGlyphBase | glyph | The glyph to alter. |
RemoveDecorator(CellDecorator, ColoredGlyphBase)
Removes the specified decorator from a glyph. If no decorators remain on the glyph, the Decorators collection is set to null.
Declaration
public static void RemoveDecorator(CellDecorator decorator, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
CellDecorator | decorator | The decorator to remove. |
ColoredGlyphBase | glyph | The glyph to alter. |
RemoveDecorators(IEnumerable<CellDecorator>, ColoredGlyphBase)
Removes the specified decorators from a glyph. If no decorators remain on the glyph, the Decorators collection is set to null.
Declaration
public static void RemoveDecorators(IEnumerable<CellDecorator> decorators, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CellDecorator> | decorators | The decorators to remove. |
ColoredGlyphBase | glyph | The glyph to alter. |
SetDecorator(CellDecorator, ColoredGlyphBase)
Replaces the decorators of a glyph with a single decorator.
Declaration
public static void SetDecorator(CellDecorator decorator, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
CellDecorator | decorator | The decorator to set. |
ColoredGlyphBase | glyph | The glyph to alter. |
SetDecorators(IEnumerable<CellDecorator>?, ColoredGlyphBase)
Replaces the decorators of a glyph.
Declaration
public static void SetDecorators(IEnumerable<CellDecorator>? decorators, ColoredGlyphBase glyph)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CellDecorator> | decorators | The decorators to set. null clears the decorators. |
ColoredGlyphBase | glyph | The glyph to alter. |