Skip to content

MatchPlayer

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

Purpose

MatchPlayer is a representation of a User during matches. It is designed to separate player variables which can change during a match from those which should remain unchanged. This particularly pertains the a Players deck, cards, and health which are all manipulated by BasicMatchController during a match.

Private Fields

Italics indicates fields is currently unused.

Type Name
Player player
Int maxPyramidCards
Int maxBoardCards
Int health
Deck deck

Public Constructor

public MatchPlayer(Player player, int maxPyramidCards, int maxBoardCards)

The constructor saves player, maxPyramidCards, and maxBoardCards to the related private fields. It also sets the health field using the player.getMaxHealth() method.

Additionally it creates a new deck which is a copy of the Users deck using the player getDeck() method and the deck addCard() method. This deck is also shuffled using deck.shuffleDeck()

Public Methods

Name Returns Parameters Description
getNextReplenish List<Card> int number Used to Remove the given number of cards from the deck and add them to the pyramid
changeHealth Void *int diff Used to increase or decrease the players health
attackedBy Void MatchCard attacker Uses the changeHealth Method to adjust health based on the attack value of the card passed as parameter
getPlayer this.player - Used to get the instance of player
getHealth this.health - Used to get the current players health
getDeck this.deck - Used to get the current players deck

Correct as at 05.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