Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.runesource.engine;
- import java.util.concurrent.Executors;
- import java.util.concurrent.ScheduledExecutorService;
- import java.util.concurrent.TimeUnit;
- import com.runesource.engine.task.TaskHandler;
- /**
- * Constructs the game reactor on its own thread.
- *
- * @author Lare96
- * @author Kadet
- *
- */
- public class Rs2GameEngine implements Runnable {
- /**
- * Constructs a {@link ScheduledExecutorService} for the {@link Rs2GameEngine}.
- */
- private static final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
- /**
- * Constructs the {@link Rs2GameEngine}.
- */
- private Rs2GameEngine() { }
- /**
- * Initializes the {@link Rs2GameEngine}.
- */
- public static void initalize() {
- executor.scheduleAtFixedRate(new Rs2GameEngine(), 0, 600,
- TimeUnit.MILLISECONDS);
- }
- @Override
- public void run() {
- try {
- //TODO: World Process
- TaskHandler.process();
- } catch (Exception exception) {
- exception.printStackTrace();
- //TODO: World Disconnect
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement