Improve error handling; fix utility command description
Revert output location to working directory for both map importers
Rework how the map tiles get populated
Remove actor comments
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
- Collection queried often via Contains use ToHashSet to speed up lookups.
- Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
- Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
This enables the map importer to map the .ini video definitions to ours.
The mapping generally is as follows:
Intro => BackgroundInfo
Brief => Briefing
Action => GameStart
Win => GameWon
Lose => GameLost
An issue in some Red Alert maps means that this mapping is not always
quite correct. In those maps that do not have a 'Brief' video defined
(scg03a is an example), Westwood has assigned the video that should
probaby have been the 'Action' video to the 'Intro' slot instead. I can
only assume that that was done due to some limitation in the original
game code. Mappers will have to correct that assignment manually in
those cases.
Upgradeable traits are notified whenever an upgrade of their declared types are granted or revoked. The traits maintain their own internal level counter, which is then used to enable or disable the trait functionality. A trait can register for multiple upgrade types which then all affect the internal level counter.
IDisabledTrait for identifying (and filtering) disabled traits
UpgradableTrait provides an abstract base for traits to support upgrade levels
Added IDisabledTrait support to GlobalButtonOrderGenerator
Includes rework by pchote with alterations.
We split the caching SpriteLoader into a SpriteCache and FrameCache. SpriteLoader instead becomes a holder for static loading methods.
Only a few classes loaded sprite frames, and they all use it with a transient cache. By moving this method into a new class, we can lose the now redundant frame cache, saving on memory significantly since the frame data array can be reclaimed by the GC. This saves ~58 MiB on frames and ~4 MiB on the caching dictionary in simple tests.