public void DestroyKnob(NoteLane lane)
    {
        var knob = lane.knobs.Last();

        lane.knobs.Remove(knob);
        //Debug.Log($"Destroying {knob}");
        Object.DestroyImmediate(knob);
    }
Exemplo n.º 2
0
 private void SetupNoteBoard()
 {
     noteBoard = GameObject.FindGameObjectWithTag("Noteboard");
     for (int i = 0; i < noteBoard.transform.childCount; i++)
     {
         NoteLane lane = noteBoard.transform.GetChild(i).GetComponent <NoteLane>();
         lane.Initialize(notesInLanes[i]);
         noteLanes[i] = lane;
     }
 }
Exemplo n.º 3
0
        public async Task <RetrospectiveNote> Handle(AddNoteCommand request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            // Get the required entities
            using IReturnDbContext returnDbContext = this._returnDbContextFactory.CreateForEditContext();

            Retrospective retrospective = await returnDbContext.Retrospectives.FindByRetroId(request.RetroId, cancellationToken);

            if (retrospective == null)
            {
                throw new NotFoundException(nameof(Retrospective), request.RetroId);
            }

            NoteLane noteLane = await returnDbContext.NoteLanes.FindAsync((KnownNoteLane)request.LaneId);

            if (noteLane == null)
            {
                throw new NotFoundException(nameof(NoteLane), (KnownNoteLane)request.LaneId);
            }

            // Save the note
            CurrentParticipantModel currentParticipant = await this._currentParticipantService.GetParticipant();

            var note = new Note {
                Retrospective     = retrospective,
                CreationTimestamp = this._systemClock.CurrentTimeOffset,
                Lane          = noteLane,
                Participant   = await returnDbContext.Participants.FindAsync(currentParticipant.Id),
                ParticipantId = currentParticipant.Id,
                Text          = String.Empty
            };

            await this._securityValidator.EnsureOperation(retrospective, SecurityOperation.AddOrUpdate, note);

            returnDbContext.Notes.Add(note);
            await returnDbContext.SaveChangesAsync(cancellationToken);

            // Return and broadcast
            var broadcastNote = this._mapper.Map <RetrospectiveNote>(note);
            var returnNote    = this._mapper.Map <RetrospectiveNote>(note);

            returnNote.IsOwnedByCurrentUser = true;

            // ... Broadcast
            await this._mediator.Publish(new NoteAddedNotification(request.RetroId, request.LaneId, broadcastNote), cancellationToken);

            return(returnNote);
        }
Exemplo n.º 4
0
        public void ShouldMap_NoteLane_ToRetrospectiveLane()
        {
            // Given
            var entity = new NoteLane {
                Id   = KnownNoteLane.Stop,
                Name = "Stop!!!"
            };

            // When
            var mapped = this.Mapper.Map <Application.Retrospectives.Queries.GetRetrospectiveStatus.RetrospectiveLane>(entity);

            // Then
            Assert.That(mapped, Is.Not.Null);

            Assert.That(mapped.Name, Is.EqualTo(entity.Name));
            Assert.That(mapped.Id, Is.EqualTo((int)entity.Id));
        }
    //private Stack<GameObject> knobs = new Stack<GameObject>();
    //public Dictionary<TimelineClip, GameObject> knobs = new Dictionary<TimelineClip, GameObject>();

    public void CreateKnob(NoteLane lane)
    {
        var knob = Object.Instantiate(lane.knobPrefab, lane.transform);

        lane.knobs.Add(knob);
    }