public IStyle GetStyle([NotNull] TileBase tile)
        {
            if (tile == null)
            {
                throw new ArgumentNullException(nameof(tile));
            }

            HashSet <TileStyle> styles;

            if (!StylesByShape.TryGetValue(tile.Shape, out styles))
            {
                return(null);
            }
            Debug.Assert(styles != null, "styles != null");

            IStyle style = GetStyle(tile, styles.Select(s => s.Style).ToArray(), ref tile.StyleState);

            return(style?.Transform(tile.Transform));
        }