Ejemplo n.º 1
0
    /// <summary>
    /// Removes a chart object (note, starpower and/or chart event) from the chart.
    /// </summary>
    /// <param name="chartObject">Item to add.</param>
    /// <param name="update">Automatically update all read-only arrays?
    /// If set to false, you must manually call the updateArrays() method, but is useful when removing multiple objects as it increases performance dramatically.</param>
    /// <returns>Returns whether the removal was successful or not (item may not have been found if false).</returns>
    public bool Remove(ChartObject chartObject, bool update = true)
    {
        bool success = SongObjectHelper.Remove(chartObject, _chartObjects);

        if (success)
        {
            chartObject.chart = null;
            chartObject.song  = null;
        }

        if (update)
        {
            UpdateCache();
        }

        return(success);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Removes an event object (section or event) from the song.
    /// </summary>
    /// <param name="autoUpdate">Automatically update all read-only arrays?
    /// If set to false, you must manually call the updateArrays() method, but is useful when removing multiple objects as it increases performance dramatically.</param>
    /// <returns>Returns whether the removal was successful or not (item may not have been found if false).</returns>
    public bool Remove(Event eventObject, bool autoUpdate = true)
    {
        bool success = false;

        success = SongObjectHelper.Remove(eventObject, _events);

        if (success)
        {
            eventObject.song = null;
        }

        if (autoUpdate)
        {
            UpdateCache();
        }

        return(success);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Removes a synctrack object (bpm or time signature) from the song.
    /// </summary>
    /// <param name="autoUpdate">Automatically update all read-only arrays?
    /// If set to false, you must manually call the updateArrays() method, but is useful when removing multiple objects as it increases performance dramatically.</param>
    /// <returns>Returns whether the removal was successful or not (item may not have been found if false).</returns>
    public bool Remove(SyncTrack syncTrackObject, bool autoUpdate = true)
    {
        bool success = false;

        if (syncTrackObject.tick > 0)
        {
            success = SongObjectHelper.Remove(syncTrackObject, _syncTrack);
        }

        if (success)
        {
            syncTrackObject.song = null;
        }

        if (autoUpdate)
        {
            UpdateCache();
        }

        return(success);
    }