Exemple #1
0
    void Move()
    {
        Vector3 position = Vector3.zero;

        if (direction == Direction.UP)
        {
            Dado bodyToMove = tail.Dequeue();
            bodyToMove.pixel.transform.position = tail.last.dado.pixel.transform.position + Vector3.up * 0.16f;
            tail.Enqueue(bodyToMove);
        }
        else if (direction == Direction.DOWN)
        {
            Dado bodyToMove = tail.Dequeue();
            bodyToMove.pixel.transform.position = tail.last.dado.pixel.transform.position + Vector3.down * 0.16f;
            tail.Enqueue(bodyToMove);
        }
        else if (direction == Direction.LEFT)
        {
            Dado bodyToMove = tail.Dequeue();
            bodyToMove.pixel.transform.position = tail.last.dado.pixel.transform.position + Vector3.left * 0.16f;
            tail.Enqueue(bodyToMove);
        }
        else if (direction == Direction.RIGHT)
        {
            Dado bodyToMove = tail.Dequeue();
            bodyToMove.pixel.transform.position = tail.last.dado.pixel.transform.position + Vector3.right * 0.16f;
            tail.Enqueue(bodyToMove);
        }
    }
Exemple #2
0
 public Programa Avancar()
 {
     if (Fila.Any())
     {
         return(Fila.Dequeue());
     }
     else
     {
         return(null);
     }
 }
Exemple #3
0
        public async Task Remover(CommandContext ctx, VoiceNextConnection vnc)
        {
            if (Fila.Count == 0)
            {
                await vnc.SendSpeakingAsync(false);

                vnc?.Disconnect();
                StatusDaFila = EnumeradorDeStatusDaFila.Parada;
            }
            else
            {
                var proximaExecucao = Fila.Dequeue();
                await AoExecutarMusica?.Invoke(proximaExecucao);
            }
        }