HandlerPlayerQuit.java 748 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package bswfx.handler;
  7. import org.json.JSONObject;
  8. import rsx.BomberStudentHandler;
  9. import bswfx.BomberStudent;
  10. /**
  11. *
  12. * @author loquicom
  13. */
  14. public class HandlerPlayerQuit implements BomberStudentHandler{
  15. @Override
  16. public boolean handle(JSONObject json) {
  17. //Verif param
  18. if(!( json.has("player") )){
  19. return false;
  20. }
  21. //Retire le joueur
  22. if(BomberStudent.game.quit(json.getInt("player"))){
  23. BomberStudent.updateWindow();
  24. return true;
  25. }
  26. return false;
  27. }
  28. }