All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skadistats.clarity.processor.runner.SimpleRunner Maven / Gradle / Ivy

Go to download

Clarity is an open source replay parser for Dota 2, CSGO, CS2 and Deadlock written in Java.

There is a newer version: 3.1.1
Show newest version
package skadistats.clarity.processor.runner;

import skadistats.clarity.source.Source;

import java.io.IOException;

public class SimpleRunner extends AbstractFileRunner {

    private final LoopController.Func controllerFunc = upcomingTick -> {
        if (!loopController.isSyncTickSeen()) {
            if (tick == -1) {
                startNewTick(0);
            }
            return LoopController.Command.FALLTHROUGH;
        }
        if (upcomingTick != tick) {
            if (upcomingTick != Integer.MAX_VALUE) {
                endTicksUntil(upcomingTick - 1);
                startNewTick(upcomingTick);
            } else {
                endTicksUntil(tick);
            }
        }
        return LoopController.Command.FALLTHROUGH;
    };

    public SimpleRunner(Source s) throws IOException {
        super(s, s.determineEngineType());
        this.loopController = new LoopController(controllerFunc);
    }

    public SimpleRunner runWith(final Object... processors) throws IOException {
        initAndRunWith(processors);
        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy