Ejemplo n.º 1
0
 public BeatmapActionParams(BeatmapActionContainer container)
 {
     notes      = container.notes;
     obstacles  = container.obstacles;
     events     = container.events;
     bpm        = container.bpm;
     selection  = container.selection;
     nodeEditor = container.nodeEditor;
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Pastes any copied objects into the map, selecting them immediately.
    /// </summary>
    public void Paste(bool triggersAction = true)
    {
        DeselectAll();
        CopiedObjects = CopiedObjects.OrderBy((x) => x._time).ToList();
        List <BeatmapObjectContainer> pasted = new List <BeatmapObjectContainer>();

        foreach (BeatmapObject data in CopiedObjects)
        {
            if (data == null)
            {
                continue;
            }
            float newTime = data._time + atsc.CurrentBeat;
            BeatmapObjectContainer pastedContainer = null;
            if (data is BeatmapNote)
            {
                BeatmapObject newData = new BeatmapNote(data.ConvertToJSON());
                newData._time = newTime;
                NotesContainer notes = collections.Where(x => x is NotesContainer).FirstOrDefault() as NotesContainer;
                pastedContainer = notes?.SpawnObject(newData);
            }
            if (data is BeatmapObstacle)
            {
                BeatmapObject newData = new BeatmapObstacle(data.ConvertToJSON());
                newData._time = newTime;
                ObstaclesContainer obstacles = collections.Where(x => x is ObstaclesContainer).FirstOrDefault() as ObstaclesContainer;
                pastedContainer = obstacles?.SpawnObject(newData);
            }
            if (data is MapEvent)
            {
                BeatmapObject newData = new MapEvent(data.ConvertToJSON());
                newData._time = newTime;
                EventsContainer events = collections.Where(x => x is EventsContainer).FirstOrDefault() as EventsContainer;
                pastedContainer = events?.SpawnObject(newData);
            }
            pasted.Add(pastedContainer);
        }
        if (triggersAction)
        {
            BeatmapActionContainer.AddAction(new SelectionPastedAction(pasted, CopiedObjects, atsc.CurrentBeat));
        }
        SelectedObjects.AddRange(pasted);
        RefreshSelectionMaterial(false);
        RefreshMap();
        Debug.Log("Pasted!");
    }
Ejemplo n.º 3
0
    private readonly float MaximumWindowTolerance = .07f; // For windowed sliders

    public SwingsPerSecond(NotesContainer notes, ObstaclesContainer obstacles)
    {
        this.notes     = notes;
        this.obstacles = obstacles;
    }