예제 #1
0
        //---------------------------------------------------------------------
        // 从Map中获取数据
        Task <byte[]> IGrainDCacheMap.getFromMap(string key)
        {
            byte[] values = null;

            MapCache.TryGetValue(key, out values);

            return(Task.FromResult(values));
        }
예제 #2
0
        private void DrawCell(Point point, Color color, bool disableCacheReading = false)
        {
            if (Cache)
            {
                if (!disableCacheReading)
                {
                    Color cachedColor;
                    var   exists = MapCache.TryGetValue(point, out cachedColor);
                    if (exists)
                    {
                        if (cachedColor.Equals(color))
                        {
                            return;
                        }
                    }
                }
                MapCache[point] = color;
            }
            var poly        = HexagonMode ? MapPointToHexagon(point) : MapPointToRectangle(point);
            var coloredPoly = new ColoredPolygon(poly.Points, color);

            DrawPolygon(point, coloredPoly);
        }