When handling the Nodes collection in MiniYaml, individual nodes are located via one of two methods:
// Lookup a single key with linear search.
var node = yaml.Nodes.FirstOrDefault(n => n.Key == "SomeKey");
// Convert to dictionary, expecting many key lookups.
var dict = nodes.ToDictionary();
// Lookup a single key in the dictionary.
var node = dict["SomeKey"];
To simplify lookup of individual keys via linear search, provide helper methods NodeWithKeyOrDefault and NodeWithKey. These helpers do the equivalent of Single{OrDefault} searches. Whilst this requires checking the whole list, it provides a useful correctness check. Two duplicated keys in TS yaml are fixed as a result. We can also optimize the helpers to not use LINQ, avoiding allocation of the delegate to search for a key.
Adjust existing code to use either lnear searches or dictionary lookups based on whether it will be resolving many keys. Resolving few keys can be done with linear searches to avoid building a dictionary. Resolving many keys should be done with a dictionary to avoid quaradtic runtime from repeated linear searches.
All magic behaviour for constructing sprite filenames
has been removed in favour of an explicit Filename
(and TilesetFilenames for tileset-specific sequences)
property.
Bibs and other effects that should be drawn at ground level
can now simply define ZRamp: 1, Offset: <X>,<Y>,1, avoiding the
need to account for the Y offset or internal sprite offsets.
In cases where the sprite has enough margin to the footprint cell edges, moving down the sprite a bit is much easier than manually setting up custom targetable offsets.
- replace WithInfantryBody with WithFacingSpriteBody + WithMoveAnimation on Titan
- rename all mech 'run' anims to 'walk'
- tweak walk anim rates to better match movement speed/original
- tweak Wolverine attack anim to play a little faster