Examples of MessageMove


Examples of cz.matfyz.aai.fantom.message.MessageMove

   
    ActorMove[] moves = new ActorMove[] {
        new ActorMove(fantomas, n2, null),
        new ActorMove(joker, n1, null)
    };
    g.placeActors(new MessageMove(moves));
    moves = new ActorMove[] {
        new ActorMove(poirot, n3, null),
        new ActorMove(batman, n4, null)
    };
    g.placeActors(new MessageMove(moves));
   
    assertSame(n2, fantomas.getCurrentPosition());
    assertSame(n1, joker.getCurrentPosition());
    assertSame(n3, poirot.getCurrentPosition());
    assertSame(n4, batman.getCurrentPosition());
   
    assertEquals(1, fantomas.getNumberOfTickets(tram));
    assertEquals(1, fantomas.getNumberOfTickets(bus));
    assertEquals(0, fantomas.getNumberOfTickets(universal));
   
    assertEquals(1, joker.getNumberOfTickets(tram));
    assertEquals(1, joker.getNumberOfTickets(bus));
    assertEquals(0, fantomas.getNumberOfTickets(universal));
   
    moves = new ActorMove[] {
        new ActorMove(fantomas, n1, tram),
        new ActorMove(joker, n6, bus)
    };
    try {
      g.moveActors(g.getActors(ClientType.PHANTOM), new MessageMove(moves));
      fail("Movement message verification failed - phantoms moved in wrong order");
    }
    catch(ProtocolException e) {
    }
  }
View Full Code Here

Examples of cz.matfyz.aai.fantom.message.MessageMove

   
    ActorMove[] moves = new ActorMove[] {
        new ActorMove(fantomas, n2, null),
        new ActorMove(joker, n1, null)
    };
    g.placeActors(new MessageMove(moves));
    moves = new ActorMove[] {
        new ActorMove(poirot, n4, null),
        new ActorMove(batman, n3, null),
        new ActorMove(japp, n5, null),
    };
    g.placeActors(new MessageMove(moves));
   
    assertSame(n2, fantomas.getCurrentPosition());
    assertSame(n1, joker.getCurrentPosition());
    assertSame(n4, poirot.getCurrentPosition());
    assertSame(n3, batman.getCurrentPosition());
    assertSame(n5, japp.getCurrentPosition());
   
    moves = new ActorMove[] {
        new ActorMove(batman, n2, bus),
        new ActorMove(japp, n6, tram),
    };
    g.moveActors(g.getActors(ClientType.DETECTIVE), new MessageMove(moves));
   
    assertSame(n4, poirot.getCurrentPosition());
    assertSame(n2, batman.getCurrentPosition());
    assertSame(n6, japp.getCurrentPosition());
   
    moves = new ActorMove[] {
        new ActorMove(batman, n3, bus),
        new ActorMove(japp, n5, tram),
    };
    try {
      g.moveActors(g.getActors(ClientType.DETECTIVE), new MessageMove(moves));
      fail("Mesage verification failed - one of the detectives did not move");
    }
    catch(ProtocolException e) {     
    }
  }
View Full Code Here

Examples of cz.matfyz.aai.fantom.message.MessageMove

      moves = agent.move();
    else {
      moves = agent.place();
      sentPlacement = true;
    }
    MessageMove msg = new MessageMove(moves);
   
    sendMessage(msg);
   
    // Re-load the message for this graph
    msg = new MessageMove(graph, msg.serialize());
    graph.updateActors(msg);
  }
View Full Code Here

Examples of cz.matfyz.aai.fantom.message.MessageMove

   *
   * @throws ServerException if the message to the server was not sent.
   */
  protected void sendPlacement() throws ServerException {
    ActorMove[] moves = agent.move();
    MessageMove msg = new MessageMove(moves);
   
    sendMessage(msg);
   
    msg = new MessageMove(graph, msg.serialize());
    graph.placeActors(msg);
  }
View Full Code Here

Examples of scotlandyard.shared.messaging.MessageMove

  public void move(Player player, int destination) {
    int src = player.getCurrentPosition();
   
    //Creates message move
    MessageMove movimento = new MessageMove(
                  player.getName(),
                  String.valueOf(destination),
                  String.valueOf(src)
                  );
View Full Code Here

Examples of scotlandyard.shared.messaging.MessageMove

          System.out.println("Conegui a mensagem! " + message);
          Message msg = (Message) message;
          MessageType type = msg.getMessageType();

          if (type == MessageType.MOVE) {
            MessageMove movimento = (MessageMove) msg;
            clearHighlights();
            mover(movimento.getSenderName(), movimento.getSource(),
                movimento.getDestination());
            //bloquear interface
            enabled = false;
          } else if(type == MessageType.GIVE_TURN){
            //desbloquear interface
            MessageGiveTurn msgg = (MessageGiveTurn)message;
View Full Code Here

Examples of scotlandyard.shared.messaging.MessageMove

    // Takes proper measures: sends message to player

    // Update BoardState
    int src = player.getCurrentPosition();
    MessageMove movimento = new MessageMove(
                  player.getName(),
                  String.valueOf(destination),
                  String.valueOf(src)
                  );
View Full Code Here

Examples of scotlandyard.shared.messaging.MessageMove

          MessageType type = msg.getMessageType();

          //TO-DO: CRIAR MENSAGEM: END-OF-TURN
          //myGame.atualizarTurnManager();
          if (type == MessageType.MOVE) {
            MessageMove movimento = (MessageMove) msg;
            clearHighlights();
            mover(movimento.getSenderName(), movimento.getSource(),
                movimento.getDestination());
            //Bloquear interface
            enabled = false;
          } else if(type == MessageType.GIVE_TURN){
            //Desbloquear interface
            MessageGiveTurn msgg = (MessageGiveTurn)message;
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.