This commit is contained in:
Eric Froemling 2020-05-20 19:14:50 -07:00
parent 53cd32bb46
commit 06600d9eeb
2 changed files with 16 additions and 16 deletions

View File

@ -92,14 +92,14 @@ PlayerType = TypeVar('PlayerType', bound='ba.Player')
class PlayerDiedMessage:
"""A message saying a ba.PlayerSpaz has died.
"""A message saying a ba.Player has died.
category: Message Classes
Attributes:
killed
If True, the spaz was killed;
If True, the player was killed;
If False, they left the game or the round ended.
how
@ -132,10 +132,10 @@ class PlayerDiedMessage:
return self._killerplayer
def getplayer(self, playertype: Type[PlayerType]) -> PlayerType:
"""Return the spaz that died.
"""Return the ba.Player that died.
The current activity is required as an argument so the exact type of
PlayerSpaz can be determined by the type checker.
The type of player for the current activity should be passed so that
the type-checker properly identifies the returned value as one.
"""
player: Any = self._player
assert isinstance(player, playertype)
@ -313,10 +313,10 @@ class HitMessage:
def get_source_player(
self, playertype: Type[PlayerType]) -> Optional[PlayerType]:
"""Return the spaz that died.
"""Return the source-player if there is one and they still exist.
The current activity is required as an argument so the exact type of
PlayerSpaz can be determined by the type checker.
The type of player for the current activity should be passed so that
the type-checker properly identifies the returned value as one.
"""
player: Any = self._source_player
assert isinstance(player, (playertype, type(None)))

View File

@ -2466,10 +2466,10 @@ and short description of the game.</p>
<dt><h4><a name="method_ba_HitMessage__get_source_player">get_source_player()</a></dt></h4><dd>
<p><span>get_source_player(self, playertype: Type[PlayerType]) -&gt; Optional[PlayerType]</span></p>
<p>Return the spaz that died.</p>
<p>Return the source-player if there is one and they still exist.</p>
<p>The current activity is required as an argument so the exact type of
PlayerSpaz can be determined by the type checker.</p>
<p>The type of player for the current activity should be passed so that
the type-checker properly identifies the returned value as one.</p>
</dd>
</dl>
@ -3823,7 +3823,7 @@ is_alive() method return True. False is returned otherwise.</p>
<h2><strong><a name="class_ba_PlayerDiedMessage">ba.PlayerDiedMessage</a></strong></h3>
<p><em>&lt;top level class&gt;</em>
</p>
<p>A message saying a ba.PlayerSpaz has died.</p>
<p>A message saying a <a href="#class_ba_Player">ba.Player</a> has died.</p>
<p>Category: <a href="#class_category_Message_Classes">Message Classes</a></p>
@ -3837,7 +3837,7 @@ is_alive() method return True. False is returned otherwise.</p>
</dd>
<dt><h4><a name="attr_ba_PlayerDiedMessage__killed">killed</a></h4></dt><dd>
<p><span>bool</span></p>
<p>If True, the spaz was killed;
<p>If True, the player was killed;
If False, they left the game or the round ended.</p>
</dd>
@ -3862,10 +3862,10 @@ If False, they left the game or the round ended.</p>
<dt><h4><a name="method_ba_PlayerDiedMessage__getplayer">getplayer()</a></dt></h4><dd>
<p><span>getplayer(self, playertype: Type[PlayerType]) -&gt; PlayerType</span></p>
<p>Return the spaz that died.</p>
<p>Return the <a href="#class_ba_Player">ba.Player</a> that died.</p>
<p>The current activity is required as an argument so the exact type of
PlayerSpaz can be determined by the type checker.</p>
<p>The type of player for the current activity should be passed so that
the type-checker properly identifies the returned value as one.</p>
</dd>
</dl>