Skip to content

Commit

Permalink
Explaining the meaning of None returned by the component state.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 587686913
Change-Id: I6f59f30d39b5bd35e3b5ab00bae257de434dd0cd
  • Loading branch information
vezhnick authored and copybara-github committed Dec 4, 2023
1 parent a962003 commit 1b1fe98
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions concordia/typing/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,28 @@ def name(
def state(
self,
) -> str | None:
"""Returns the current state of the component."""
"""Returns the current state of the component.
Returns:
state of the component or None. If none is returned, then the component
will be omitted while forming the context of action.
"""
pass

def partial_state(
self,
player_name: str,
) -> str | None:
"""Returns the specified player's view of the component's current state."""
"""Returns the specified player's view of the component's current state.
Args:
player_name: the name of the player for which the view is generated.
Returns:
specified player's view of the component's current state or None. If none
is returned, then the component will not be sent to the player.
"""

del player_name
return None

Expand Down

0 comments on commit 1b1fe98

Please sign in to comment.