Базовые события

This commit is contained in:
Gravit 2018-10-18 20:46:51 +07:00
parent 5c99ffd69a
commit 01fdbdf305
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,23 @@
package ru.gravit.launcher.events;
import ru.gravit.utils.event.EventInterface;
import java.util.UUID;
//Набор стандартных событий
public class ControlEvent implements EventInterface {
private static final UUID uuid = UUID.fromString("f1051a64-0cd0-4ed8-8430-d856a196e91f");
public enum ControlCommand {
STOP,START,PAUSE,CONTINUE,CRASH
}
public ControlEvent(ControlCommand signal) {
this.signal = signal;
}
public ControlCommand signal;
@Override
public UUID getUUID() {
return uuid;
}
}

View file

@ -0,0 +1,16 @@
package ru.gravit.launcher.events;
import ru.gravit.utils.event.EventInterface;
import java.util.UUID;
//Пустое событие
//Все обработчики обязаны его игнорировать
public final class PingEvent implements EventInterface {
private static final UUID uuid = UUID.fromString("7c8be7e7-82ce-4c99-84cd-ee8fcce1b509");
@Override
public UUID getUUID() {
return uuid;
}
}

View file

@ -0,0 +1,17 @@
package ru.gravit.launcher.events;
import ru.gravit.utils.event.EventInterface;
import java.util.UUID;
//Используется, что бы послать короткое сообщение, которое вмещается в int
public class SignalEvent implements EventInterface {
private static final UUID uuid = UUID.fromString("edc3afa1-2726-4da3-95c6-7e6994b981e1");
public int signal;
public SignalEvent(int signal) {
this.signal = signal;
}
@Override
public UUID getUUID() {
return uuid;
}
}