Exemplo n.º 1
0
    public void triggerArm(BeatmapNote note, NotesContainer container)
    {
        //Ignore bombs here to improve performance.
        if (!Settings.Instance.BongoBoye || note._type == BeatmapNote.NOTE_TYPE_BOMB)
        {
            return;
        }
        BeatmapObject next = container.UnsortedObjects.Find(x => x._time > note._time &&
                                                            ((BeatmapNote)x)._type == note._type);
        float timer = 0.125f;

        if (!(next is null))
        {
            float half = container.AudioTimeSyncController.GetSecondsFromBeat((next._time - note._time) / 2f);
            timer = next != null?Mathf.Clamp(half, 0.05f, 0.2f) : 0.125f;   // clamp to accommodate sliders and long gaps between notes
        }

        switch (note._type)
        {
        case BeatmapNote.NOTE_TYPE_A:
            Larm        = true;
            LarmTimeout = timer;
            break;

        case BeatmapNote.NOTE_TYPE_B:
            Rarm        = true;
            RarmTimeout = timer;
            break;
        }
    }
Exemplo n.º 2
0
    public void triggerArm(BeatmapNote note, NotesContainer container)
    {
        if (!Settings.Instance.BongoBoye)
        {
            return;
        }
        BeatmapObjectContainer next = container.LoadedContainers.Where(x => x.objectData._time > note._time &&
                                                                       ((BeatmapNote)x.objectData)._type == note._type).OrderBy(x => x.objectData._time).FirstOrDefault();
        float timer = 0.125f;

        if (!(next is null))
        {
            float half = note._type != BeatmapNote.NOTE_TYPE_BOMB ? container.AudioTimeSyncController.GetSecondsFromBeat((next.objectData._time - note._time) / 2f) : 0f; // ignore bombs
            timer = next ? Mathf.Clamp(half, 0.05f, 0.2f) : 0.125f;                                                                                                       // clamp to accommodate sliders and long gaps between notes
        }

        switch (note._type)
        {
        case BeatmapNote.NOTE_TYPE_A:
            Larm        = true;
            LarmTimeout = timer;
            break;

        case BeatmapNote.NOTE_TYPE_B:
            Rarm        = true;
            RarmTimeout = timer;
            break;
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// Save note with data in view-model properties
        /// </summary>
        private void SaveCommand_Execute()
        {
            if (Title == "")
            {
                App.Current.MainPage.DisplayAlert("Input issue", "Title must not be empty!", "Ok");
                return;
            }

            //setup note model object
            Note note = new Note();

            note.Title       = Title;
            note.Description = Description;
            note.Done        = false;
            if (DeadlineEnable)
            {
                note.Deadline = Deadline;
            }
            else
            {
                note.Deadline = null;
            }

            //reset props
            Title          = "";
            Description    = "";
            Deadline       = DateTime.Now;
            DeadlineEnable = false;

            //save note
            NotesContainer.AddNote(note);
        }
Exemplo n.º 4
0
 public BeatmapActionParams(BeatmapActionContainer container)
 {
     notes      = container.notes;
     obstacles  = container.obstacles;
     events     = container.events;
     bpm        = container.bpm;
     selection  = container.selection;
     nodeEditor = container.nodeEditor;
 }
Exemplo n.º 5
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!");
    }
Exemplo n.º 6
0
    public void triggerArm(BeatmapNote note, NotesContainer container)
    {
        if (!Settings.Instance.BongoBoye)
        {
            return;
        }
        BeatmapObjectContainer next = container.LoadedContainers.Where(x => x.objectData._time > note._time &&
                                                                       (x.objectData as BeatmapNote)._type == note._type).OrderBy(x => x.objectData._time).FirstOrDefault();
        float half = next ? container.AudioTimeSyncController.GetSecondsFromBeat((next.objectData._time - note._time) / 2f)
            : 0.125f;

        switch (note._type)
        {
        case BeatmapNote.NOTE_TYPE_A:
            Larm        = true;
            LarmTimeout = half;
            break;

        case BeatmapNote.NOTE_TYPE_B:
            Rarm        = true;
            RarmTimeout = half;
            break;
        }
    }
Exemplo n.º 7
0
 public NotesContainerTests()
 {
     _notesContainer = new NotesContainer(_mockNotesRepository.Object);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Mark note model as done
 /// </summary>
 private void MarkAsDoneCommand_Execute()
 {
     NotesContainer.MarkAsDone(note);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Delete note model
 /// </summary>
 private void DeleteCommand_Execute()
 {
     NotesContainer.DeleteNote(note);
 }
Exemplo n.º 10
0
 protected override async void OnStart()
 {
     //Must initialize data when app starts
     await NotesContainer.Initialize();
 }
Exemplo n.º 11
0
    private readonly float MaximumWindowTolerance = .07f; // For windowed sliders

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