The map generator is already performant, but we can remove a few rough edges from infrastructure it interacts with. - Add TypeDictionary constructor to clone from an existing copy. The map editor infrastructure relies heavily on cloning ActorReferences and the underlying dictionaries. A dedicated clone method avoids reflection overhead for CreateTypeContainer on a fresh instance. - Use ThrowIndexOutOfRangeException helper. This allows the Index method to be inlined. - Reuse lists in FloodFill. This avoids allocating and resizing new lists on each loop when we can reuse the existing capacity. - Manage CellEntryChanged at the layer rather than individual previews. We only need to attach/detach from the delegate once at the layer, rather than many times as previews are added and removed.
20 KiB
20 KiB