From 01fdbdf305ecae7f1d991acbe315191b24bf9c0e Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 18 Oct 2018 20:46:51 +0700 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B7=D0=BE=D0=B2=D1=8B=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launcher/events/ControlEvent.java | 23 +++++++++++++++++++ .../ru/gravit/launcher/events/PingEvent.java | 16 +++++++++++++ .../gravit/launcher/events/SignalEvent.java | 17 ++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 libLauncher/src/main/java/ru/gravit/launcher/events/ControlEvent.java create mode 100644 libLauncher/src/main/java/ru/gravit/launcher/events/PingEvent.java create mode 100644 libLauncher/src/main/java/ru/gravit/launcher/events/SignalEvent.java diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/ControlEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/ControlEvent.java new file mode 100644 index 00000000..7f5c9028 --- /dev/null +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/ControlEvent.java @@ -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; + } +} diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/PingEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/PingEvent.java new file mode 100644 index 00000000..2712b5c3 --- /dev/null +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/PingEvent.java @@ -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; + } +} diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/SignalEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/SignalEvent.java new file mode 100644 index 00000000..2e469657 --- /dev/null +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/SignalEvent.java @@ -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; + } +}