Skip to content

Commit 04ae11e

Browse files
committed
Added some comments
1 parent 4a9b631 commit 04ae11e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/GameView.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,14 @@ void DrawingGameVisitor::visit(DevelopmentCard& card) {
494494

495495
}
496496

497+
/**
498+
* Construct a trading view.
499+
* @param initiating The player initiating the trade.
500+
* @param receiving The other player involved in the trade.
501+
* @param trade The callback for the "trade" button, invoked with the current offer.
502+
* @param cancel The callback for the "cancel" button
503+
* @param initialOffer The initial offer to display.
504+
*/
497505
TradingView::TradingView(Player& initiating, Player& receiving, std::function<bool(std::array<int, 5>, ScreenCoordinate)> trade, std::function<bool(ScreenCoordinate)> cancel, std::array<int, 5> initialOffer) :
498506
ViewElement({{0.1, 0.1},{0.9, 0.9}}), initiating(initiating), receiving(receiving),
499507
trade(std::bind(trade, std::ref(offer), std::placeholders::_1), {{0.7, 0.1}, {0.9, 0.2}}, "resources/TypeWritersSubstitute-Black.ttf", 50, "Trade"),
@@ -502,10 +510,17 @@ TradingView::TradingView(Player& initiating, Player& receiving, std::function<bo
502510

503511
}
504512

513+
/**
514+
* Destroy the TradingView.
515+
*/
505516
TradingView::~TradingView() {
506517

507518
}
508519

520+
/**
521+
* Handle a user clicking on the TradingView.
522+
* @param coord The coordinate clicked on.
523+
*/
509524
bool TradingView::clicked(ScreenCoordinate coord) {
510525
if(cancel.handleClick(coord)) {
511526
return true;
@@ -520,6 +535,9 @@ bool TradingView::clicked(ScreenCoordinate coord) {
520535
return true;
521536
}
522537

538+
/**
539+
* Render the TradingView.
540+
*/
523541
void TradingView::render() {
524542
glBindTexture(GL_TEXTURE_2D, 0);
525543
glColor3d(1, 1, 0);

0 commit comments

Comments
 (0)