thesadrogue / TheSadRogue.Integration

An integration library between SadConsole and GoRogue
MIT License
8 stars 5 forks source link

SortOrder in RoguelikeComponent Desynchronized #34

Closed Chris3606 closed 3 years ago

Chris3606 commented 3 years ago

Issue

Currently, RogulikeComponent implements both IGameObjectComponent (via ComponentBase), and SadConsole.Components.IComponent. IComponent defines a SortOrder value, but GoRogue depends on GoRogue.Components.ISortedComponent for that, which ComponentBase does not implement; so the orders are not reflected in AllComponents.

Proposed Solution

ComponentBase and ComponentBase<T> should both implement GoRogue.Components.ISortedComponent, and their SortOrder property should be pointed at IComponent.SortOrder so they stay in sync. Unfortunately, this is currently difficult, because SadConsole's SortOrder is defined as an int, but GoRogue's is defined as a uint. SadConsole currently has plans to change to uint, so this will be easy to implement after that change.

Chris3606 commented 3 years ago

Beta4 is released that has this changed; a fix will be required when the project is updated to ensure things compile.