Fixes regression from 649e7e8c28. When the Templates was changed from a Dictionary to a FrozenDictionary, this caused the items to be reordered. Some code was relying on the previous behaviour where the Dictionary ordering would happen to remain the same as the YAML input.
Fix this by creating a TemplatesInDefinitionOrder which can be used to iterate in the same ordering as given in YAML. Code that depends on the ordering can use this, and other code that does lookups can use the FrozenDictionary.
- Converts OpenRA.Mods.Common/MapGenerator/Direction.cs over to using
Direction and DirectionMask enums
- Moves direction-related utilities into Exts classes.
- Simplifies some direction utility logic.
Only very small numerical precision behavioral changes.
Allows PickAny templates to be used in MultiBrushes, which can be
painted with random selection. This avoids the need to define various
separate MultiBrushes for each tile combination.
Note that all combinations count as part of a single MultiBrush, which
may influence selection weighting.
This MultiBrush feature is not presently used in OpenRA's official
mods, but is useful for unofficial mods using more general PickAny
templates.
Adds MultiBrush definitions for River (RA and CnC) and WaterCliff (RA
only), allowing them to be tiled with the Path Tiling tool.
A small enhancement to the MultiBrush and TilingPathTool code is added
to allow the inner type to be derived from start and end types. This
allows segments that interface between types (such as WaterCliff to
Beach) to be usable when tiling either WaterCliffs or Beach. Whilst
this makes the inner types of many of the existing MultiBrushes
redundant, no simplification is performed as part of this change.
Exposes the TilingPath code used by the map generator as a map editor
tool to help automate the process of tiling sequences of templates
together.
No additional template stitching definitions are added as part of this
commit. As such, the tool currently only supports the same auto tiling
as the map generator does. This includes:
- RA and CnC support.
- Beaches, land cliffs, and roads.
Support for additional mods and templates can be added in follow-ups
by adding the necessary MultiBrush definitions.
Related changes included in this commit to support this work include:
- Add support for sparse EditorBlits.
- Add support for MultiBrush to EditorBlitSource conversion.
- Add support for EditorBlitSource previewing.
- Adjust the "Road" types used in segmented MultiBrush definitions.