@@ -411,7 +411,10 @@ void Player::setGenralModifier()
411411 }
412412}
413413
414-
414+ /* *
415+ * Plays a victory point card if it exists. This means, the Player will 'consume' the card to gain a baseVictoryPoint
416+ * @ return true if the card was played, false otherwise
417+ */
415418bool Player::playVictoryCard (){
416419 if (developmentCards[VICTORYPOINT] > 0 ){
417420 developmentCards[VICTORYPOINT]--;
@@ -421,6 +424,11 @@ bool Player::playVictoryCard(){
421424 return false ;
422425}
423426
427+ /* *
428+ * Plays a knight card if it exists. This means the player will move the Knight and gain 1 random resource from a player around the robber's new position
429+ * @ param Coordinate of the robber's new position and Player& of the opponent to rob
430+ * @return true if the card was used, false otherwise
431+ */
424432bool Player::playKnight (Coordinate location, Player& opponent){
425433 if (developmentCards[KNIGHT] > 0 && board.canRobberRob (opponent, location)){
426434 board.moveRobber (location);
@@ -436,6 +444,12 @@ bool Player::playKnight(Coordinate location, Player& opponent){
436444 }
437445 return false ;
438446}
447+
448+ /* *
449+ * Plays a year of plenty card if it exists. This means the player will gain 2 of 1 resource of their choice
450+ * @ param the resource the player will recieve
451+ * @ returns true if the card was played, false otherwise
452+ */
439453bool Player::playYearOfPlenty (int resourceType){
440454 if (resourceType >= 5 )
441455 return false ;
@@ -447,6 +461,12 @@ bool Player::playYearOfPlenty(int resourceType){
447461 }
448462 return false ;
449463}
464+
465+ /* *
466+ * Plays a monopoly card if it exists. This means the player will steal all of 1 resource type from all the other players
467+ * @ param the resource type the player wants to steal
468+ * @ return true if the card was played, false otherwise
469+ */
450470bool Player::playMonopoly (int resourceType){
451471 if (resourceType >= 5 )
452472 return false ;
@@ -460,6 +480,12 @@ bool Player::playMonopoly(int resourceType){
460480 }
461481 return false ;
462482}
483+
484+ /* *
485+ * Plays a road building card if it exists. This means the player will place two roads of their choosing for free
486+ * @ param the start and end Coordinates of the two roads the Player wants to place
487+ * @ return true if the card was played
488+ */
463489bool Player::playRoadBuilding (Coordinate start1, Coordinate end1, Coordinate start2, Coordinate end2){
464490 if (developmentCards[ROADBUILDING] > 0 ){
465491 if (board.canPlayBuildRoadCard (start1, end1, start2, end2, *this )){
@@ -478,13 +504,16 @@ bool Player::playRoadBuilding(Coordinate start1, Coordinate end1, Coordinate sta
478504 return false ;
479505}
480506
481-
507+ /* *
508+ * A cheat class that gives the player 5 of every development card, meant for debugging
509+ */
482510void Player::giveDevCardBoon (){
483511 for (int i = 0 ; i < 5 ; i++){
484512 developmentCards[i]+=5 ;
485513 }
486514}
487515
516+
488517int Player::getDevelopmentCards (int card_type) const {
489518 return developmentCards[card_type];
490519}
@@ -505,7 +534,11 @@ int Player::getRoadBuildingCards() const{
505534 return developmentCards[ROADBUILDING];
506535}
507536
508-
537+ /* *
538+ * The player gives all their resources of a specific resource type. Meant to compliment the Monopoly card
539+ * @ param the resource type to give
540+ * @ return the number of resources given
541+ */
509542int Player::giveAllResources (int resourceType){
510543 int resource_count = resources[resourceType];
511544 resources[resourceType] = 0 ;
0 commit comments