Package clueless.model.decks

Examples of clueless.model.decks.LocationCard


        button.addActionListener(new SelectCard());
        cardPanel.add(button);
      }   
      else if (card instanceof LocationCard)
      {
      LocationCard locationCard = ((LocationCard)card);
        switch(locationCard.getLocationName())
        {
          case BALLROOM:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Ballroom.gif");
            break;
          case BILLIARD_ROOM:
            resource = Main.class.getResource("/clueless/main/resources/rooms/BilliardRoom.gif");
            break;
          case CONSERVATORY:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Conservatory.gif");
            break;
          case DINING_ROOM:
            resource = Main.class.getResource("/clueless/main/resources/rooms/DiningRoom.gif");
            break;
          case HALL:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Hall.gif");
            break;
          case KITCHEN:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Kitchen.gif");
            break;
          case LIBRARY:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Library.gif");
            break;
          case LOUNGE:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Lounge.gif");
            break;
          case STUDY:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Study.gif");
            break;
        }//location card type swtich
       

        /** get URL to image */
        try {
          buttonIcon = ImageIO.read(resource);
        } catch (IOException e) {
          // TODO Auto-generated catch block
          System.err.print(e.toString());
        }
       
        //Scale it to the UI size
        ImageIcon locationIcon = new ImageIcon(buttonIcon.getScaledInstance(96, 150, 0));
       
        //Instantiate image button
        RoomButton locationButton = new RoomButton(locationIcon, locationCard.getLocationName());
        locationButton.setBorder(new LineBorder(Color.BLACK, 5));
        locationButton.setBorderPainted(true);
        locationButton.addActionListener(new SelectCard());
        cardPanel.add(locationButton);
      }//location else if
View Full Code Here


    this.controller = controller;
    controller.addModel(this);
   
    // Get one of each type of character card (pre-shuffle)
    for(RoomName card : RoomName.values()){
      this.deck.add(new LocationCard(controller, card));
    }
   
    // Shuffle the deck so we have random order.
    shuffle();
  }
View Full Code Here

        selectedCardType = new WeaponCard(controller, weapon.getType());
      }
      else if(button instanceof RoomButton)
      {
        RoomButton location = (RoomButton)button;
        selectedCardType = new LocationCard(controller, location.getType());//location.getType();
      }
      System.out.println(selectedCardType.getCardType());
      controller.fireDisproveCardEvent(new DisproveCardEvent(this, selectedCardType));
      controller.removeModel(selectedCardType);
      frame.dispose();
View Full Code Here

            break;
        }
      }   
      else if (hand.get(i) instanceof LocationCard)
      {
      LocationCard locationCard = ((LocationCard)hand.get(i));
        switch(locationCard.getLocationName())
        {
          case BALLROOM:
            resource = Main.class.getResource("/clueless/main/resources/rooms/Ballroom.gif");
            break;
          case BILLIARD_ROOM:
View Full Code Here

TOP

Related Classes of clueless.model.decks.LocationCard

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.