Exemplo n.º 1
0
        //============================================================
        // <T>层选中变更。</T>
        //
        // @param sender 发送者
        // @param e:event 事件
        //============================================================
        private void lvwLayers_ItemChecked(object sender, ItemCheckedEventArgs e)
        {
            bool        check = e.Item.Checked;
            object      item  = e.Item.Tag;
            FMbMapLayer layer = item as FMbMapLayer;

            if (layer.OptionValid != check)
            {
                layer.OptionValid = check;
                _designer.Paint();
            }
        }
Exemplo n.º 2
0
        //============================================================
        // <T>绘制层。</T>
        //============================================================
        public void DrawLayers()
        {
            FObjects <FMbMapLayer> layers = _map.Layers;

            if (!layers.IsEmpty())
            {
                int count = layers.Count;
                for (int n = 0; n < count; n++)
                {
                    FMbMapLayer layer = layers[n];
                    if (layer.OptionValid)
                    {
                        _cellSize  = layer.CellSize;
                        _cellCount = layer.CellCount;

                        FObjects <FMbMapCell> cells = layer.MapCell;
                        int cellCount = cells.Count;
                        for (int x = 0; x < cellCount; x++)
                        {
                            FMbMapCell cell       = cells[x];
                            int        resourceId = cell.ResourceId;
                            if (0 == resourceId)
                            {
                                continue;
                            }
                            SIntPoint2 cellIndex = cell.Index;

                            FMbMapTile mapTile = RMobileManager.MapTileConsole.FindMapTile(resourceId);
                            if (null != mapTile)
                            {
                                DrawMapTile(mapTile, cellIndex);
                            }
                        }
                    }
                    // 绘制方格
                    DrawLine();
                }
            }
        }