Ejemplo n.º 1
0
        public void MirrorNoteNE()
        {
            var notesContainer = BeatmapObjectContainerCollection.GetCollectionForType(BeatmapObject.Type.NOTE);
            var root           = notesContainer.transform.root;
            var notePlacement  = root.GetComponentInChildren <NotePlacement>();

            var noteA = new BeatmapNote
            {
                _time         = 2,
                _type         = BeatmapNote.NOTE_TYPE_A,
                _lineIndex    = BeatmapNote.LINE_INDEX_FAR_LEFT,
                _lineLayer    = BeatmapNote.LINE_LAYER_BOTTOM,
                _customData   = JSON.Parse("{\"_position\": [-1, 0]}"),
                _cutDirection = BeatmapNote.NOTE_CUT_DIRECTION_LEFT
            };

            notePlacement.queuedData  = noteA;
            notePlacement.RoundedTime = notePlacement.queuedData._time;
            notePlacement.ApplyToMap();

            SelectionController.Select(noteA);

            _mirror.Mirror();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_B, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_RIGHT, JSON.Parse("{\"_position\": [1, 0]}"));

            // Undo mirror
            _actionContainer.Undo();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_A, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT, JSON.Parse("{\"_position\": [-1, 0]}"));
        }
Ejemplo n.º 2
0
        public void MirrorME()
        {
            var notesContainer = BeatmapObjectContainerCollection.GetCollectionForType(BeatmapObject.Type.NOTE);
            var root           = notesContainer.transform.root;
            var notePlacement  = root.GetComponentInChildren <NotePlacement>();

            var noteA = new BeatmapNote(2, -2345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_TYPE_A, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);

            notePlacement.queuedData  = noteA;
            notePlacement.RoundedTime = notePlacement.queuedData._time;
            notePlacement.ApplyToMap();

            SelectionController.Select(noteA);

            _mirror.Mirror();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_B, 5345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_RIGHT);

            // Undo mirror
            _actionContainer.Undo();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_A, -2345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);
        }
Ejemplo n.º 3
0
        public void Mirror()
        {
            _mirror.Mirror();

            // Check we can still delete our objects
            var toDelete = _notesContainer.UnsortedObjects.FirstOrDefault();

            _notesContainer.DeleteObject(toDelete);
            Assert.AreEqual(1, _notesContainer.LoadedObjects.Count);

            _actionContainer.Undo();

            Assert.AreEqual(2, _notesContainer.LoadedObjects.Count);

            NoteTest.CheckNote(_notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_B, BeatmapNote.LINE_INDEX_FAR_RIGHT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_RIGHT);
            NoteTest.CheckNote(_notesContainer, 1, 3, BeatmapNote.NOTE_TYPE_A, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_TOP, BeatmapNote.NOTE_CUT_DIRECTION_UP_LEFT);

            // Undo mirror
            _actionContainer.Undo();

            NoteTest.CheckNote(_notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_A, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);
            NoteTest.CheckNote(_notesContainer, 1, 3, BeatmapNote.NOTE_TYPE_B, BeatmapNote.LINE_INDEX_FAR_RIGHT, BeatmapNote.LINE_LAYER_TOP, BeatmapNote.NOTE_CUT_DIRECTION_UP_RIGHT);
        }