Package cz.matfyz.aai.fantom.game

Examples of cz.matfyz.aai.fantom.game.TransportType


      return new MessageUpdate(graph, detectiveMoves.getMoves(), ClientType.DETECTIVE);
    }

    logger.debug("Distributing tickets used by detectives to phantoms");
    for(MessageMove.ActorMove m : detectiveMoves.getMoves()) {
      TransportType transport = m.getTransportType();

      if(transport.isUsedByPhantom()) {
        int lucky = rnd.nextInt(phantoms.size()); //TODO: With multiple phantoms, how should the tickets be distributed?
        Actor luckyActor = phantoms.get(lucky);
        logger.info(String.format("Phantom %s gets one ticket for transport %s", luckyActor.getId(), transport.getName()));
        phantoms.get(lucky).addTicket(transport);
      }
    }

    // Inform the phantom.
View Full Code Here


      this.tickets = new HashMap<TransportType, Integer>();
      for(Entry<Object, Object> prop : record.entrySet()) {
        String key = (String)prop.getKey();
        String countStr = (String)prop.getValue();
       
        TransportType ttype = graph.getTransportType(key);
        if(ttype == null)
          continue;
       
        try {
          int count = Integer.parseInt(countStr);
View Full Code Here

    assertNotNull(fantomas);
   
    Node nd1 = g.getNode("1");
    assertNotNull(nd1);
   
    TransportType bus = g.getTransportType("bus");
    assertNotNull(bus);
   
    ActorMove move = new ActorMove(fantomas, nd1, null);
    Properties record = move.serialize();
   
View Full Code Here

  public void testLoadUpdatePhantom() throws Exception {
    Graph g = new Graph(TEST_GRAPH);
   
    MessageUpdate msg = new MessageUpdate(g, Parser.parseLines(MESSAGE_UPDATE_PHANTOM));

    TransportType tram = g.getTransportType("tram");
    assertNotNull(tram);

    ActorMove[] moves = msg.getMoves();
    assertNotNull(moves);
    assertEquals(2, moves.length);
View Full Code Here

  public void testLoadPlacementDetective() throws Exception {
    Graph g = new Graph(TEST_GRAPH);
   
    MessageUpdate msg = new MessageUpdate(g, Parser.parseLines(MESSAGE_PLACEMENT_DETECTIVE));
   
    TransportType tram = g.getTransportType("tram");
    assertNotNull(tram);
   
    ActorMove[] moves = msg.getMoves();
    assertNotNull(moves);
    assertEquals(2, moves.length);
View Full Code Here

    Actor batman = g.getActor("Batman");
    assertNotNull(batman);
    Actor joker = g.getActor("Joker");
    assertNotNull(joker);
   
    TransportType bus = g.getTransportType("bus");
    assertNotNull(bus);
    TransportType tram = g.getTransportType("tram");
    assertNotNull(tram);
   
    Node n3 = g.getNode("3");
    assertNotNull(n3);
    Node n4 = g.getNode("4");
View Full Code Here

TOP

Related Classes of cz.matfyz.aai.fantom.game.TransportType

Copyright © 2018 www.massapicom. 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.