Closed Thraka closed 1 year ago
FocusedConsoles (this uses a stack-based system, so is there a framework interface/base for that?)
@Thraka ICollection<T>
and IReadOnlyCollection<T>
is the closest you can probably get to this. That's all C#'s built-in Stack implements: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.stack-1?view=net-7.0
Closing this. I did quite a bit of work in some areas, but I feel like it's good enough and I want to move on from it.
Framework guide says that collection types should conform to one of the base classes or interfaces, such as
IList<T>
.With how many of the new types are being implemented in SadConsole, I think
IList<T>
is the way to go. TheControlsHost
is close to it. Because theControlsConsole
implements the host as.Controls
you don't wantControlsHost.Controls
for the collection, because then you end up withControlsConsole.Controls.Controls
to get to the collection of the controls.ControlsHost
should implementIList<T>
(and practically does) but other collections should also follow this pattern:ControlsHost
LayeredConsole
(coming soon)ScreenObject.Children
FocusedConsoles
(this uses a stack-based system, so is there a framework interface/base for that?)EntityRenderer
IContainer
(may satisfy another interface as it implementsIReadOnlyList
and adds a few other methods)Also, the
EffectSet
uses linked list when it probably doesn't need to. It could be cleaned up.