ソースを参照

Ajout fichier handler

Loquicom 6 年 前
コミット
c20bc67233

+ 23 - 0
Client/src/main/java/test/HandlerAttackAffect.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerAttackAffect implements BomberStudentHandler {
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Handler Attack Affect : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerAttackBomb.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerAttackBomb implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Handler Attack Bomb : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerAttackExplode.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerAttackExplode implements BomberStudentHandler {
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Handler Attack Explode : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerPlayerJoin.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerPlayerJoin implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Join Handler : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerPlayerMajorEnd.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerPlayerMajorEnd implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Player Major End Handler : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerPlayerMove.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerPlayerMove implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Player Move Handler : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 23 - 0
Client/src/main/java/test/HandlerPlayerQuit.java

@@ -0,0 +1,23 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author loquicom
+ */
+public class HandlerPlayerQuit implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Player quit : " + json.toString(1));
+        return true;
+    }
+    
+}

+ 21 - 0
Client/src/main/java/test/HandlerServerEnd.java

@@ -0,0 +1,21 @@
+package test;
+
+import org.json.JSONObject;
+import rsx.BomberStudentClient;
+import rsx.BomberStudentHandler;
+
+/**
+ *
+ * @author Arthur Brandao
+ */
+public class HandlerServerEnd implements BomberStudentHandler{
+
+    @Override
+    public boolean handle(JSONObject json) {
+        System.out.println("Handler server/end");
+        ServerTest.code = Integer.parseInt(json.getString("statut"));
+        ServerTest.stop.set(true);
+        return true;
+    }
+    
+}