// Path: app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.java
// public static int TUTORIAL_ANIMATION_DURATION = 400; // 400 ~ 500 seems legit


import android.util.Log;
import java.util.ArrayList;
import static com.bedrock.padder.model.tutorial.Tutorial.TUTORIAL_ANIMATION_DURATION;
package com.bedrock.padder.model.tutorial;




public class TimingListener {

    public static ArrayList<Timing> timings = new ArrayList<>();

    // attach on TutorialView
    public static void listen(Timing timing) {
        if (timings.indexOf(timing) >= 0) {
            timings.remove(timing);
            Log.e("broadcast", "duplicate: listener removed for " + timing.toString());
        }
        timings.add(timing);
        Log.i("broadcast", "listener added for " + timing.toString());
    }

    // attach on Pad
    public static boolean broadcast(Timing timing) {
        int index = timings.indexOf(timing);
        if (index >= 0) {
            Timing listening = timings.get(index);
            // timing configuration
            int delay = (int) (timing.listenTime - listening.listenTime
// Path: app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.java
// public static int TUTORIAL_ANIMATION_DURATION = 400; // 400 ~ 500 seems legit


// Path: app/src/main/java/com/bedrock/padder/model/tutorial/TimingListener.java
import android.util.Log;
import java.util.ArrayList;
import static com.bedrock.padder.model.tutorial.Tutorial.TUTORIAL_ANIMATION_DURATION;

package com.bedrock.padder.model.tutorial;




public class TimingListener {

    public static ArrayList<Timing> timings = new ArrayList<>();

    // attach on TutorialView
    public static void listen(Timing timing) {
        if (timings.indexOf(timing) >= 0) {
            timings.remove(timing);
            Log.e("broadcast", "duplicate: listener removed for " + timing.toString());
        }
        timings.add(timing);
        Log.i("broadcast", "listener added for " + timing.toString());
    }

    // attach on Pad
    public static boolean broadcast(Timing timing) {
        int index = timings.indexOf(timing);
        if (index >= 0) {
            Timing listening = timings.get(index);
            // timing configuration
            int delay = (int) (timing.listenTime - listening.listenTime
                    - (TUTORIAL_ANIMATION_DURATION + 100));