Skip to content

Commit 0340314

Browse files
committed
Add missing 'number' property for Outcome.
1 parent dab6a39 commit 0340314

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.github/workflows/tools.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ jobs:
4040
steps:
4141
- uses: actions/checkout@v4
4242
- name: Install dependencies
43-
run: brew install automake autoconf wxwidgets
43+
run: brew install automake autoconf wxwidgets@3.2
4444
- run: aclocal
4545
- run: automake --add-missing
4646
- run: autoconf
47-
- run: ./configure
47+
- run: ./configure --with-wx-config=wx-config-3.2
4848
- run: make
4949
- run: sudo make install
5050
- run: make osx-dmg
5151
- uses: actions/upload-artifact@v4
5252
with:
53-
name: artifact-macos
53+
name: artifact-osx
5454
path: "*.dmg"
5555

5656
windows:
@@ -64,7 +64,7 @@ jobs:
6464
- uses: msys2/setup-msys2@v2
6565
with:
6666
install: mingw-w64-x86_64-toolchain make automake autoconf
67-
- run: pacman -S --noconfirm mingw-w64-x86_64-wxmsw3.2
67+
- run: pacman -S --noconfirm mingw-w64-x86_64-wxwidgets3.2
6868
- run: aclocal
6969
- run: automake --add-missing
7070
- run: autoconf

doc/pygambit.api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Information about the game
120120
:toctree: api/
121121

122122
Outcome.label
123+
Outcome.number
123124
Outcome.game
124125

125126
.. autosummary::

src/core/list.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,6 @@ template <class T> T &List<T>::operator[](int num)
348348
return n->m_data;
349349
}
350350

351-
template <class T> List<T> List<T>::operator+(const List<T> &b) const
352-
{
353-
List<T> result(*this);
354-
Node *n = b.m_head;
355-
while (n) {
356-
result.Append(n->data);
357-
n = n->m_next;
358-
}
359-
return result;
360-
}
361-
362351
template <class T> List<T> &List<T>::operator+=(const List<T> &b)
363352
{
364353
Node *n = b.m_head;

src/pygambit/outcome.pxi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class Outcome:
7272
warnings.warn("Another outcome with an identical label exists")
7373
self.outcome.deref().SetLabel(value.encode("ascii"))
7474

75+
@property
76+
def number(self) -> int:
77+
"""Returns the number of the outcome in the game.
78+
Outcomes are numbered starting with 0.
79+
"""
80+
return self.outcome.deref().GetNumber() - 1
81+
7582
def __getitem__(
7683
self, player: typing.Union[Player, str]
7784
) -> typing.Union[decimal.Decimal, Rational]:

0 commit comments

Comments
 (0)