Skip to content
Millie Macdonald edited this page Jan 18, 2017 · 1 revision

Purpose

This page contains the details of the Deck Class, its purpose and methods for manipulating it. The Deck class is designed to represent a players physical deck both within a match and outside of a match. A players deck within a match is able to be manipulated while a Users deck and their number of valid decks should remain immutable. Each Deck consists of the deck name and a list of cards however their are multiple ways to construct a valid deck.

Private Fields

Italics indicates fields is currently unused.

Type Name
String DEFAULT_NAME = "New Deck"
String name
List cards

Public Constructor

Calling public Deck() will Create an empty deck with the default name. This is useful for creating a deck that the AI will reason with during a match.

Calling public Deck(String name) will Create an empty deck with the name = name. This is useful for creating a deck that a User will own.

Calling public Deck(Deck other) will Create a new deck using the cards and name from the deck other. This effectively copies a deck and is used to create a mutable deck within a match.

Calling public Deck(Deck _other, String name) will Create a new deck using the cards from the deck other and set the name equal to name. This is used within the DeckViewController to save and update a users deck name.

Calling public Deck(Cardlist cardlist) will Create a new deck using the cards from cardlist with the default name. This is used to generate a new deck from a list of cards most often in the case of a new users. To create a starter deck or basic deck for the AI.

Public Methods

Name Returns Parameters Description
getNullCard New NullCard - Used to by the AI when reasoning how to attack during a match
getName this.name - Used to return the name of the deck
getCards new ArrayList<>(cards) - Used to get a list of cards from the deck
getAmount Int Card card Used to get the amount of a single card in a deck
size cards.size() - Used to get the total amount of cards in a deck
equalTo Boolean Deck other Used to check if all the cards in deck other and the current deck are the same. If all cards are the same return true else return false

Correct as at 19.09.16 @lyndonmoore

Home

Saving and Loading

Statistics tracking

Game Play

APIs


Game Guide

Other Guides

Design Guides

Overviews

Features

Animations

Splash Screen & Create Account Screen

Player Account Settings

AI

Duck Dust


Brainstorming


Future Development


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally