Skip to content

Commit 3c052b1

Browse files
Rename Game.comment to Game.description (#755)
1 parent 3413d60 commit 3c052b1

15 files changed

Lines changed: 35 additions & 26 deletions

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [16.6.0] - unreleased
4+
5+
### Changed
6+
- `Game.comment` has been renamed to `Game.description`
7+
8+
39
## [16.5.1] - unreleased
410

511
### Fixed

doc/pygambit.api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Information about the game
9595
:toctree: api/
9696

9797
Game.title
98-
Game.comment
98+
Game.description
9999
Game.is_const_sum
100100
Game.is_tree
101101
Game.is_perfect_recall

src/games/file.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ Game BuildNfg(GameFileLexer &p_parser, TableFileGame &p_data)
440440
// If this looks lke an outcome-based format, then don't create outcomes in advance
441441
Game nfg = NewTable(p_data.NumStrategies(), p_parser.GetCurrentToken() == TOKEN_LBRACE);
442442
nfg->SetTitle(p_data.m_title);
443-
nfg->SetComment(p_data.m_comment);
443+
nfg->SetDescription(p_data.m_comment);
444444

445445
for (auto player : nfg->GetPlayers()) {
446446
player->SetLabel(p_data.GetPlayer(player->GetNumber()));
@@ -865,7 +865,7 @@ Game ReadEfgFile(std::istream &p_stream, bool p_normalizeLabels /* = false */)
865865
ReadPlayers(parser, game, treeData);
866866
if (parser.GetNextToken() == TOKEN_TEXT) {
867867
// Read optional comment
868-
game->SetComment(parser.GetLastText());
868+
game->SetDescription(parser.GetLastText());
869869
parser.GetNextToken();
870870
}
871871
ParseNode(parser, game, game->GetRoot(), treeData);

src/games/game.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void GameRep::WriteNfgFile(std::ostream &p_file) const
229229
}) << std::endl;
230230
}
231231
p_file << "}" << std::endl;
232-
p_file << std::quoted(GetComment()) << std::endl << std::endl;
232+
p_file << std::quoted(GetDescription()) << std::endl << std::endl;
233233

234234
for (auto iter : StrategyContingencies(
235235
StrategySupportProfile(std::const_pointer_cast<GameRep>(shared_from_this())))) {

src/games/game.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,9 @@ class GameRep : public std::enable_shared_from_this<GameRep> {
888888
virtual void SetTitle(const std::string &p_title) { m_title = p_title; }
889889

890890
/// Get the text comment associated with the game
891-
virtual const std::string &GetComment() const { return m_comment; }
891+
virtual const std::string &GetDescription() const { return m_comment; }
892892
/// Set the text comment associated with the game
893-
virtual void SetComment(const std::string &p_comment) { m_comment = p_comment; }
893+
virtual void SetDescription(const std::string &p_comment) { m_comment = p_comment; }
894894

895895
/// Return the version number of the game. The version is incremented after each
896896
/// substantive change to the game (i.e. not merely involving labels)

src/games/gametable.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ void GameTableRep::WriteNfgFile(std::ostream &p_file) const
469469
}) << std::endl;
470470
}
471471
p_file << "}" << std::endl;
472-
p_file << std::quoted(GetComment()) << std::endl << std::endl;
472+
p_file << std::quoted(GetDescription()) << std::endl << std::endl;
473473

474474
p_file << "{" << std::endl;
475475
for (auto outcome : m_outcomes) {

src/games/gametree.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ void GameTreeRep::WriteEfgFile(std::ostream &p_file, const GameNode &p_subtree /
11961196
<< FormatList(GetPlayers(),
11971197
[](const GamePlayer &p) { return QuoteString(p->GetLabel()); })
11981198
<< std::endl;
1199-
p_file << std::quoted(GetComment()) << std::endl << std::endl;
1199+
p_file << std::quoted(GetDescription()) << std::endl << std::endl;
12001200
Gambit::WriteEfgFile(p_file, (p_subtree) ? p_subtree : GetRoot());
12011201
}
12021202

src/games/stratspt.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void StrategySupportProfile::WriteNfgFile(std::ostream &p_file) const
100100
}) << std::endl;
101101
}
102102
p_file << "}" << std::endl;
103-
p_file << std::quoted(m_game->GetComment()) << std::endl << std::endl;
103+
p_file << std::quoted(m_game->GetDescription()) << std::endl << std::endl;
104104

105105
for (const auto &iter : StrategyContingencies(*this)) {
106106
p_file << FormatList(

src/gui/dlgameprop.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ GamePropertiesDialog::GamePropertiesDialog(wxWindow *p_parent, GameDocument *p_d
5151
commentSizer->Add(new wxStaticText(this, wxID_STATIC, _("Comment")), 0, wxALL | wxALIGN_CENTER,
5252
5);
5353
m_comment = new wxTextCtrl(this, wxID_ANY,
54-
wxString(m_doc->GetGame()->GetComment().c_str(), *wxConvCurrent),
54+
wxString(m_doc->GetGame()->GetDescription().c_str(), *wxConvCurrent),
5555
wxDefaultPosition, wxSize(400, -1), wxTE_MULTILINE);
5656
commentSizer->Add(m_comment, 1, wxALL | wxALIGN_CENTER, 5);
5757
topSizer->Add(commentSizer, 1, wxALL | wxEXPAND, 0);

src/gui/dlgameprop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GamePropertiesDialog final : public wxDialog {
3434

3535
// Data access (only valid when ShowModal() returns with wxID_OK)
3636
wxString GetTitle() const override { return m_title->GetValue(); }
37-
wxString GetComment() const { return m_comment->GetValue(); }
37+
wxString GetDescription() const { return m_comment->GetValue(); }
3838
};
3939

4040
} // namespace Gambit::GUI

0 commit comments

Comments
 (0)