Android Open Source - wherewithal House Deck






From Project

Back to project page wherewithal.

License

The source code is released under:

GNU General Public License

If you think the Android project wherewithal listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.curchod.domartin;
/* w w  w .  j ava 2 s.com*/
import java.util.Hashtable;

import com.curchod.dto.DeckCard;

/**
 * Modelling this xml info:
 *     <house_deck>
 *         <deck_id/>
 *         <player_id/>
 *         <game_id/>
 *         <name>??Player A??</name>
 *         <size>24</size>
 *       <card>
 *         <id/>
 *         <name/>
 *         <index/>
 *         <type/>
 *      </card>
 *       ...
 *    </house_deck>
 * @author user
 *
 */
public class HouseDeck 
{

  private String deck_id;
  private String player_id;
  private String game_id;
  private String deck_name;
  private Hashtable <String,DeckCard> cards;
  private int number_of_reading_cards;
  private int number_of_writing_cards;
  
  
  
  public HouseDeck()
  {
    cards = new Hashtable <String,DeckCard> ();
    number_of_reading_cards = 0;
    number_of_writing_cards = 0;
  }
  
      //-- name
    public void setDeckName(String _deck_name)
    {
      deck_name = _deck_name;
    }
    
    public String getDeckName()
    {
      return deck_name;
    }
    
    //-- id
    public void setDeckId(String _deck_id)
    {
      deck_id = _deck_id;
    }
      
    public String getDeckId()
    {
      return deck_id;
    }
    
    public void setPlayerId(String _player_id)
    {
       player_id = _player_id;
    }
    
    /**
     */
    public String getPlayerId()
    {
      return  player_id;
    }
    
    
    // game id
    public void setGameId(String _game_id)
    {
      game_id = _game_id;
    }
    
    /**
     */
    public String getGameId()
    {
      return  game_id;
    }
    
    
    
    
    /**
     */
    public Hashtable <String,DeckCard> getCards()
    {
      return  cards;
    }
    
    /**
     * id-DeckCard pairs
     */
    public void setCards(String index, DeckCard _card)
    {
       cards.put(index, _card);
       String type = _card.getType();
       if (type.equals(Constants.READING))
       {
         number_of_reading_cards++;
       } else if (type.equals(Constants.WRITING))
       {
         number_of_writing_cards++;
       }
    }
    
    /**
     * id-DeckCard pairs
     */
    public void setCards(Hashtable <String,DeckCard> _cards)
    {
       cards = _cards;
    }
    
    /**
     * Return the card_id of a card using the index key.
     * @param player_id
     * @return
     */
    public DeckCard getCard(String index)
    {
      return  cards.get(index);
    }
    
    public int getNumberOfReadingCards()
    {
      return number_of_reading_cards;
    }
    
    public int getNumberOfWritingCards()
    {
      return number_of_writing_cards;
    }
  
}




Java Source Code List

com.curchod.domartin.AsyncLoadGameFile.java
com.curchod.domartin.Constants.java
com.curchod.domartin.Filer.java
com.curchod.domartin.HouseDeck.java
com.curchod.domartin.IWantTo.java
com.curchod.domartin.MockNdefMessages.java
com.curchod.domartin.NfcUtils.java
com.curchod.domartin.RemoteCall.java
com.curchod.domartin.Sarray.java
com.curchod.domartin.Scoring.java
com.curchod.domartin.TagDescription.java
com.curchod.domartin.UtilityTo.java
com.curchod.dto.Card.java
com.curchod.dto.DeckCard.java
com.curchod.dto.GameWord.java
com.curchod.dto.Game.java
com.curchod.dto.PlayerInfo.java
com.curchod.dto.SavedTest.java
com.curchod.dto.SingleWordTestResult.java
com.curchod.dto.SingleWord.java
com.curchod.json.VocabularyDefinition.java
com.curchod.json.VocabularyLearningObject.java
com.curchod.wherewithal.AddPlayerActivity.java
com.curchod.wherewithal.CardDeckActivity.java
com.curchod.wherewithal.CardDecksActivity.java
com.curchod.wherewithal.CardPlayerHouseDeckActivity.java
com.curchod.wherewithal.CardPlayerWordsActivity.java
com.curchod.wherewithal.CardPlayersListActivity.java
com.curchod.wherewithal.CardsActivity.java
com.curchod.wherewithal.GameConcentrationActivity.java
com.curchod.wherewithal.GameReadingStonesActivity.java
com.curchod.wherewithal.GameReadingStonesInstructionsActivity.java
com.curchod.wherewithal.GameSnazzyThumbworkActivity.java
com.curchod.wherewithal.GameWritingStonesActivity.java
com.curchod.wherewithal.GamesActivity.java
com.curchod.wherewithal.InstructionsActivity.java
com.curchod.wherewithal.MainActivity.java
com.curchod.wherewithal.PlayerActivity.java
com.curchod.wherewithal.PlayersActivity.java