Repository navigation
Tile knowledge duplicates - #1114
mikes-wandering wants to merge 2 commits into
Conversation
|
Thanks - I think I can see the duplication, and the fix seems reasonable. Three things:
EngineStorage.InitializeGameDataForTests(new C7GameData.GameData());
Creating tile tests is tricky. I've thought about a template scheme a number of times, and many of our current tests have various ad hoc tile gen implementations. We really should come up with a proper string-based tile generation scheme. C# of course supports multiline strings, so we could have something like: var map = @"
.....
...M.
..MM.
..M..
";
MapGen.Parse(map); |
|
Thanks. I've just started working with this code base and there's many things I don't understand yet. I started by writing some tests to help build my knowledge, and was surprised to see 59 tiles returned from GetTilesVisibleToUnit!
|
TileKnowedge GetTilesVisibleToUnit returns duplicate tiles. It finds outer ring tiles by looking at the neighbors of all the inner ring tiles, many of which overlap. This can cause wasted effort when callers process the duplicates.