示例#1
0
        public GameMap CreateMap(String name, MapFolder folder)
        {
            FileInfo file = new FileInfo(name);

            int newId = Id++;

            String filename = GetMapFileName(newId, name);

            file.CopyTo(filename, true);

            if (folder.FolderPath == null && folder.Id == 0)
            {
                folder.FolderPath = new ObservableCollection <int>()
                {
                    0
                };
            }


            GameMap map = new GameMap(newId, filename, file.Name.Substring(0, file.Name.Length - file.Extension.Length), new List <int>(folder.FolderPath));

            MapStub stub = new MapStub(map);

            CurrentFolder.Maps.Add(stub);
            map.CanSave = true;
            map.SaveMap(true);

            return(map);
        }
        private void SetMarkers(Point p)
        {
            GameMap.MapCell cell = PointToCell(p);
            if (CellOnBoard(cell))
            {
                List <GameMap.MapCell> list = PointToCellArray(p, brushSize);

                foreach (var c in list)
                {
                    if (CellOnBoard(c))
                    {
                        if (eraseMode)
                        {
                            map.DeleteAllMarkers(c);
                        }
                        else
                        {
                            GameMap.Marker marker = new GameMap.Marker();
                            marker.Style = markerStyle;
                            marker.Color = markerColor;
                            map.SetMarker(c, marker);
                        }
                    }
                }
                map.SaveMap(false);
                map.FireFogOrMarkerChanged();
            }
        }
示例#3
0
        public GameMap CreateMap(String name)
        {
            GameMap map = new GameMap(Id++, name);

            MapStub stub = new MapStub(map);

            Maps.Add(stub);
            map.CanSave = true;
            map.SaveMap(true);

            return(map);
        }
示例#4
0
        public GameMap CreateMap(String name)
        {
            FileInfo file = new FileInfo(name);

            int newId = Id++;

            String filename = GetMapFileName(newId, name);

            file.CopyTo(filename);

            GameMap map = new GameMap(newId, filename, file.Name.Substring(0, file.Name.Length - file.Extension.Length));

            MapStub stub = new MapStub(map);

            Maps.Add(stub);
            map.CanSave = true;
            map.SaveMap(true);

            return(map);
        }