mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 07:23:37 +08:00
Tidying
This commit is contained in:
parent
53cd32bb46
commit
06600d9eeb
@ -92,14 +92,14 @@ PlayerType = TypeVar('PlayerType', bound='ba.Player')
|
|||||||
|
|
||||||
|
|
||||||
class PlayerDiedMessage:
|
class PlayerDiedMessage:
|
||||||
"""A message saying a ba.PlayerSpaz has died.
|
"""A message saying a ba.Player has died.
|
||||||
|
|
||||||
category: Message Classes
|
category: Message Classes
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
|
|
||||||
killed
|
killed
|
||||||
If True, the spaz was killed;
|
If True, the player was killed;
|
||||||
If False, they left the game or the round ended.
|
If False, they left the game or the round ended.
|
||||||
|
|
||||||
how
|
how
|
||||||
@ -132,10 +132,10 @@ class PlayerDiedMessage:
|
|||||||
return self._killerplayer
|
return self._killerplayer
|
||||||
|
|
||||||
def getplayer(self, playertype: Type[PlayerType]) -> PlayerType:
|
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
|
The type of player for the current activity should be passed so that
|
||||||
PlayerSpaz can be determined by the type checker.
|
the type-checker properly identifies the returned value as one.
|
||||||
"""
|
"""
|
||||||
player: Any = self._player
|
player: Any = self._player
|
||||||
assert isinstance(player, playertype)
|
assert isinstance(player, playertype)
|
||||||
@ -313,10 +313,10 @@ class HitMessage:
|
|||||||
|
|
||||||
def get_source_player(
|
def get_source_player(
|
||||||
self, playertype: Type[PlayerType]) -> Optional[PlayerType]:
|
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
|
The type of player for the current activity should be passed so that
|
||||||
PlayerSpaz can be determined by the type checker.
|
the type-checker properly identifies the returned value as one.
|
||||||
"""
|
"""
|
||||||
player: Any = self._source_player
|
player: Any = self._source_player
|
||||||
assert isinstance(player, (playertype, type(None)))
|
assert isinstance(player, (playertype, type(None)))
|
||||||
|
|||||||
@ -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>
|
<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]) -> Optional[PlayerType]</span></p>
|
<p><span>get_source_player(self, playertype: Type[PlayerType]) -> 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
|
<p>The type of player for the current activity should be passed so that
|
||||||
PlayerSpaz can be determined by the type checker.</p>
|
the type-checker properly identifies the returned value as one.</p>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</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>
|
<h2><strong><a name="class_ba_PlayerDiedMessage">ba.PlayerDiedMessage</a></strong></h3>
|
||||||
<p><em><top level class></em>
|
<p><em><top level class></em>
|
||||||
</p>
|
</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>
|
<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>
|
</dd>
|
||||||
<dt><h4><a name="attr_ba_PlayerDiedMessage__killed">killed</a></h4></dt><dd>
|
<dt><h4><a name="attr_ba_PlayerDiedMessage__killed">killed</a></h4></dt><dd>
|
||||||
<p><span>bool</span></p>
|
<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>
|
If False, they left the game or the round ended.</p>
|
||||||
|
|
||||||
</dd>
|
</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>
|
<dt><h4><a name="method_ba_PlayerDiedMessage__getplayer">getplayer()</a></dt></h4><dd>
|
||||||
<p><span>getplayer(self, playertype: Type[PlayerType]) -> PlayerType</span></p>
|
<p><span>getplayer(self, playertype: Type[PlayerType]) -> 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
|
<p>The type of player for the current activity should be passed so that
|
||||||
PlayerSpaz can be determined by the type checker.</p>
|
the type-checker properly identifies the returned value as one.</p>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user