Package clueless.model.decks

Source Code of clueless.model.decks.LocationDeck

package clueless.model.decks;

import java.util.ArrayList;

import clueless.controller.GameController;
import clueless.model.Room.RoomName;
import clueless.model.decks.LocationCard;

/**
* Class for representing the deck of location cards in Clue-less.
*
* @author T
*/
public class LocationDeck extends Deck{
  /**
   * Public constructor.
   */
  public LocationDeck(GameController controller){
    this.type = DeckType.LOCATION_DECK;
    this.cardsUsed = 0;
    this.deck = new ArrayList<Card>(RoomName.values().length);
    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();
  }
}
TOP

Related Classes of clueless.model.decks.LocationDeck

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.