Exemplo n.º 1
0
        /// <summary>
        /// Converts the specified beatmap in to a game-specific variant version of beatmap.
        /// </summary>
        protected IPlayableMap Convert(IOriginalMap original)
        {
            var newBeatmap = CreateMap(original);

            newBeatmap.HitObjects = ConvertHitObjects(original.HitObjects);
            return(newBeatmap);
        }
Exemplo n.º 2
0
        public void DeleteMap(IOriginalMap map)
        {
            if (map == null)
            {
                Logger.LogWarning("Attempted to delete a null map.");
                return;
            }

            var mapset = map.Detail.Mapset;

            if (mapset == null)
            {
                throw new Exception($"Could not retrieve the mapset of specified map: {map.Metadata.Artist} - {map.Metadata.Title}");
            }

            // Delete the mapset itself if there is only one map.
            if (mapset.Maps.Count == 1)
            {
                DeleteMapset(mapset);
                return;
            }

            // If this map is currently selected, make it select the previous map.
            var selectedOriginal = selection.Map.Value?.OriginalMap;

            if (selectedOriginal == map)
            {
                selection.SelectMap(mapset.GetMapBefore(selectedOriginal));
            }

            store.DeleteMap(map);
            mapset.Maps.Remove(map);
            OnDeleteMap?.Invoke(map);
        }
Exemplo n.º 3
0
        public void DeleteMap(IOriginalMap map)
        {
            var file = map.Detail.MapFile;

            if (!file.Exists)
            {
                throw new Exception($"Attempted to delete map that does not exist: {map.Metadata.Artist} - {map.Metadata.Title}");
            }
            file.Delete();
            file.Refresh();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Event called on map deletion from map manager.
        /// </summary>
        private void OnDeleteMap(IOriginalMap map)
        {
            var mapset = SelectedMapset.Value;

            if (mapset == null)
            {
                return;
            }

            // Trigger change on the maps list.
            MapList.Trigger();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Shows the map actions dialog overlay.
        /// </summary>
        public void ShowMapActions(IOriginalMap map)
        {
            if (map == null)
            {
                Logger.LogWarning("Attempted to show map actions for a null map.");
                return;
            }

            var dialogModel = OverlayNavigator.Show <DialogOverlay>().Model;

            dialogModel.SetMessage($"Select an action for the version ({map.Detail.Version})");
            dialogModel.AddOption(new DialogOption()
            {
                Callback = () => OnMapActionDelete(map),
                Label    = "Delete",
                Color    = ColorPreset.Warning
            });
            dialogModel.AddOption(new DialogOption()
            {
                Label = "Cancel",
                Color = ColorPreset.Negative
            });
        }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new beatmap for current game mode.
 /// </summary>
 protected virtual PlayableMap <T> CreateMap(IOriginalMap map) => new PlayableMap <T>(Map);
Exemplo n.º 7
0
 protected MapConverter(IOriginalMap map)
 {
     this.Map = map;
 }
Exemplo n.º 8
0
 // TODO:
 public override Rulesets.Maps.IMapConverter CreateConverter(IOriginalMap map) => null;
Exemplo n.º 9
0
 public Map(IOriginalMap map) : base(map)
 {
 }
Exemplo n.º 10
0
 public PlayableMap(IOriginalMap map)
 {
     OriginalMap = map;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Event called on selecting delete in map actions dialog.
 /// </summary>
 private void OnMapActionDelete(IOriginalMap map)
 {
     MapManager.DeleteMap(map);
 }
Exemplo n.º 12
0
 public void SelectMap(IOriginalMap map) => SelectMap(map.GetPlayable(currentMode));
Exemplo n.º 13
0
 public abstract IMapConverter CreateConverter(IOriginalMap map);