Examples of IPlayer


Examples of scotlandyard.engine.spec.IPlayer

      if(selected_game==null || "".equals(selected_game)){throw new Exception("Game id is missing");}

      final IGame game = Engine.instance().games.get(selected_game);
      if(game==null){throw new Exception("GAME is unknow");}

      final IPlayer player = game.getPlayer(xhash);
      if(player==null){throw new Exception("UNKNOWN Player");}
     
      final Integer[]legalMoves = game.getLegalMoves(player.getEmail());
     
      int transports = legalMoves[node];
      out.println("<div class='transport_options'>");
      transports = showTransportButton(out,transports,16);
      transports = showTransportButton(out,transports,8);
View Full Code Here

Examples of scotlandyard.engine.spec.IPlayer

      if(gameId==null || "".equals(gameId)){throw new Exception("Game Id is unknown");}

      final IGame game = Engine.instance().games.get(gameId);
      if(game==null){throw new Exception("Game is unknown");}

      final IPlayer player = game.getPlayer(xhash);
      if(player==null){throw new Exception("player is unknown");}

      final String moves = Arrays.toString(game.getLegalMoves(player.getEmail())).replace("{", "[").replace("}", "]").replace("null", "0");
      final IPlayer mrx = game.getMrX();
      if(mrx==null){
        throw new Exception("MR X Is not there");
      }
      String position = "-1";
      if(game.isRoundExposingMrX(game.getRound())){
        position = mrx.getPosition()+"";
      }
      out.print("{\"msg\" : "+ moves +", \"mrx\" : { \"position\" : "+ position +", \"face\" : \""+ mrx.getIcon() +"\", \"name\" : \""+mrx.getName()+"\"} }");

    }catch(Exception e){
     
      out.print("{\"msg\" : \"EXCEPTION : "+(e.getMessage()+"").replace("\"", "'")+"\", \"className\" : \""+getClass().getName()+"\"}");
    }
View Full Code Here

Examples of scotlandyard.engine.spec.IPlayer

          if(game_id==null || "".equals(game_id)){throw new Exception("Game id is missing");}

          final IGame game = Engine.instance().games.get(game_id);
          if(game==null){throw new Exception("GAME is unknow");}

          final IPlayer player = game.getPlayer(xhash);
          if(player==null){throw new Exception("UNKNOWN Player");}

          sb.append("<div class='player_tickets'><table cellpadding='2' class='tokens'>");
          final StringBuffer sb1 = new StringBuffer();
          final StringBuffer sb2 = new StringBuffer();
          for(int i=0;i<5;i++){
              final String tr = BMap.convTransport(i);
              final String url = "http://scotlandyard.comule.com/get_icon.php?icon=";
              sb1.append("<td><img src='"+url+pow2(i)+"' alt='"+tr+"' title='"+tr+"' id='transport_"+i+"'/></td>");
              sb2.append("<th>"+player.getTickets(i)+"</th>");
          }
          sb.append("<tr>"+sb1.toString()+"</tr>");
          sb.append("<tr>"+sb2.toString()+"</tr>");
          sb.append("</table>");
      }catch(Exception e){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.