@@ -411,7 +411,10 @@ void Player::setGenralModifier()
411
411
}
412
412
}
413
413
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
+ */
415
418
bool Player::playVictoryCard (){
416
419
if (developmentCards[VICTORYPOINT] > 0 ){
417
420
developmentCards[VICTORYPOINT]--;
@@ -421,6 +424,11 @@ bool Player::playVictoryCard(){
421
424
return false ;
422
425
}
423
426
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
+ */
424
432
bool Player::playKnight (Coordinate location, Player& opponent){
425
433
if (developmentCards[KNIGHT] > 0 && board.canRobberRob (opponent, location)){
426
434
board.moveRobber (location);
@@ -436,6 +444,12 @@ bool Player::playKnight(Coordinate location, Player& opponent){
436
444
}
437
445
return false ;
438
446
}
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
+ */
439
453
bool Player::playYearOfPlenty (int resourceType){
440
454
if (resourceType >= 5 )
441
455
return false ;
@@ -447,6 +461,12 @@ bool Player::playYearOfPlenty(int resourceType){
447
461
}
448
462
return false ;
449
463
}
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
+ */
450
470
bool Player::playMonopoly (int resourceType){
451
471
if (resourceType >= 5 )
452
472
return false ;
@@ -460,6 +480,12 @@ bool Player::playMonopoly(int resourceType){
460
480
}
461
481
return false ;
462
482
}
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
+ */
463
489
bool Player::playRoadBuilding (Coordinate start1, Coordinate end1, Coordinate start2, Coordinate end2){
464
490
if (developmentCards[ROADBUILDING] > 0 ){
465
491
if (board.canPlayBuildRoadCard (start1, end1, start2, end2, *this )){
@@ -478,13 +504,16 @@ bool Player::playRoadBuilding(Coordinate start1, Coordinate end1, Coordinate sta
478
504
return false ;
479
505
}
480
506
481
-
507
+ /* *
508
+ * A cheat class that gives the player 5 of every development card, meant for debugging
509
+ */
482
510
void Player::giveDevCardBoon (){
483
511
for (int i = 0 ; i < 5 ; i++){
484
512
developmentCards[i]+=5 ;
485
513
}
486
514
}
487
515
516
+
488
517
int Player::getDevelopmentCards (int card_type) const {
489
518
return developmentCards[card_type];
490
519
}
@@ -505,7 +534,11 @@ int Player::getRoadBuildingCards() const{
505
534
return developmentCards[ROADBUILDING];
506
535
}
507
536
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
+ */
509
542
int Player::giveAllResources (int resourceType){
510
543
int resource_count = resources[resourceType];
511
544
resources[resourceType] = 0 ;
0 commit comments