Skip to content

Commit

Permalink
Merge pull request #26 from Kaszanas/AS_Documentation
Browse files Browse the repository at this point in the history
[PR] Andrzej Szczap Documentation
  • Loading branch information
Kaszanas authored Jun 9, 2022
2 parents bc55966 + 99c31ff commit 5298ac0
Show file tree
Hide file tree
Showing 24 changed files with 183 additions and 233 deletions.
26 changes: 13 additions & 13 deletions src/dataset/replay_data/replay_parser/game_events/events/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@

from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Can the sequence be an int here?
# Should this be encoded somehow if there is a NoneType detected?

# TODO: Document the docstrings


class Cmd(GameEvent):
"""_summary_
"""
Cmd is containing some "details" information about command interface events
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param otherUnit: _description_
:param otherUnit: There is no specific information about this parameter
:type otherUnit: NoneType
:param sequence: _description_
:param sequence: Highly likely this parameter specifies an id parameter which sequence user has typed in the console,
there is no specific information about this parameter
:type sequence: int
:param unitGroup: _description_
:param unitGroup: There is no specific information about this parameter
:type unitGroup: NoneType | int
:param userid: _description_
:param userid: Highly likely this parameter specifies a user's id who has been using interface, there is no specific information.
:type userid: int
"""

@staticmethod
def from_dict(d: Dict) -> "Cmd":
"""_summary_
"""
Static method returning initialized Cmd class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized Cmd class.
:rtype: Cmd
"""
return Cmd(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class CmdUpdateTargetUnit(GameEvent):
@staticmethod
def from_dict(d: Dict) -> "CmdUpdateTargetUnit":
"""
Static method returning initialized CmdUpdateTargetPoint class from a dictionary. This helps with the original JSON parsing.
Static method returning initialized CmdUpdateTargetUnit class from a dictionary. This helps with the original JSON parsing.
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: Returns an initialized CmdUpdateTargetPoint class.
:return: Returns an initialized CmdUpdateTargetUnit class.
:rtype: CmdUpdateTargetUnit
"""
return CmdUpdateTargetUnit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,32 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Document the docstrings


class CommandManagerState(GameEvent):
"""_summary_
"""
CommandManagerState type containing information about some states during the game, time, player, etc.
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param sequence: _description_
:param sequence: Highly likely this parameter specifies an id parameter which sequence the player has made,
there is no specific information about this parameter
:type sequence: int
:param state: _description_
:param state: Highly likely this parameter specifies an id parameter which state the player has made,
there is no specific information about this parameter
:type state: int
:param userid: _description_
:param userid: Specifies id number of player who has managed the state, example: in 1v1 game: [0,1]
:type userid: int
"""

@staticmethod
def from_dict(d: Dict) -> "CommandManagerState":
"""_summary_
"""
Static method returning initialized CommandManagerState class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized CommandManagerState class.
:rtype: CommandManagerState
"""
return CommandManagerState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Document the docstrings


class ControlGroupUpdate(GameEvent):
"""_summary_
"""
ControlGroupUpdate is containing some "details" information about updates and changes player's control groups in the game
:param controlGroupIndex: _description_
:param controlGroupIndex: Highly likely this parameter specifies an id parameter which control group has selected by the player in the game
:type controlGroupIndex: int
:param controlGroupUpdate: _description_
:param controlGroupUpdate: Highly likely this parameter specifies an id parameter which control group has changed by the player in the game
:type controlGroupUpdate: int
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param userid: _description_
:param userid: Specifies id number of player who has updated the group control the game
:type userid: int
"""

@staticmethod
def from_dict(d: Dict) -> "ControlGroupUpdate":
"""_summary_
"""
Static method returning initialized ControlGroupUpdate class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized ControlGroupUpdate class.
:rtype: ControlGroupUpdate
"""
return ControlGroupUpdate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,28 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Document the docstrings


class GameUserLeave(GameEvent):
"""
_summary_
GameUserLeave is containing some "details" information about player's leaving the game like time, reason, etc.
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param leaveReason: _description_
:param leaveReason: Specifies a number which determinate leaving reason, there are no more details
:type leaveReason: int
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param userid: _description_
:param userid: Specifies id number of player who has left the game
:type userid: int
"""

@staticmethod
def from_dict(d: Dict) -> "GameUserLeave":
"""_summary_
"""
Static method returning initialized GameUserLeave class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized GameUserLeave class.
:rtype: GameUserLeave
"""
return GameUserLeave(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,30 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Document the docstrings


class SelectionDelta(GameEvent):
"""
_summary_
SelectionDelta is containing some "details" information about player's selection during the game
:param controlGroupId: _description_
:param controlGroupId: Specifies the event id of the control group, which has been selected
:type controlGroupId: int
:param delta: _description_
:param delta: Specifies the game loop number (game-engine tick) when at which the event occurred
:type delta: Delta
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param userid: _description_
:param userid: Specifies id number of player who has done selection option in the game
:type userid: int
"""

@staticmethod
def from_dict(d: Dict) -> "SelectionDelta":
"""
_summary_
Static method returning initialized SelectionDelta class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized SelectionDelta class.
:rtype: SelectionDelta
"""
return SelectionDelta(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,55 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent


# TODO: Document the docstrings


class UserOptions(GameEvent):
"""_summary_
"""
UserOptions is containing some "details" information about player's settings, profiles, configuration in the game.
:param baseBuildNum: _description_
:param baseBuildNum: Specifies a unique version number of the game build, highly likely game engine number
:type baseBuildNum: int
:param buildNum: _description_
:param buildNum: Specifies a unique version number of the build, highly likely game build number
:type buildNum: int
:param cameraFollow: _description_
:param cameraFollow: Specifies if the camera object is following an object
:type cameraFollow: bool
:param debugPauseEnabled: _description_
:param debugPauseEnabled: There is no valuable information about this parameter
:type debugPauseEnabled: bool
:param developmentCheatsEnabled: _description_
:param developmentCheatsEnabled: Specifies if cheat option for developers have been enabled
:type developmentCheatsEnabled: bool
:param gameFullyDownloaded: _description_
:param gameFullyDownloaded: Specifies if the game was fully downloaded, with campaign, better graphic settings, etc.
:type gameFullyDownloaded: bool
:param hotkeyProfile: _description_
:param hotkeyProfile: Specifies the name of the player's hotkey group, the player was playing on in the game
:type hotkeyProfile: str
:param id: _description_
:param id: Specifies the ID of an event which corresponds to its name.
:type id: int
:param isMapToMapTransition: _description_
:param isMapToMapTransition: There is no valuable information about this parameter
:type isMapToMapTransition: bool
:param loop: _description_
:param loop: Specifies the game loop number (game-engine tick) when at which the event occurred
:type loop: int
:param multiplayerCheatsEnabled: _description_
:param multiplayerCheatsEnabled: Specifies if the game was having cheat options enabled in the game
:type multiplayerCheatsEnabled: bool
:param platformMac: _description_
:param platformMac: Specifies if the game has been played on the Mac operating system
:type platformMac: bool
:param syncChecksummingEnabled: _description_
:param syncChecksummingEnabled: There is no valuable information about this parameter
:type syncChecksummingEnabled: bool
:param testCheatsEnabled: _description_
:param testCheatsEnabled: Specifies if the game was having tests on, to detect cheats
:type testCheatsEnabled: bool
:param useGalaxyAsserts: _description_
:param useGalaxyAsserts: There is no valuable information about this parameter
:type useGalaxyAsserts: bool
:param userid: _description_
:param userid: Specifies the id of the player who has been the owner of the options in the game
:type userid: int
:param versionFlags: _description_
:param versionFlags: There is no valuable information about this parameter, might it be a player's setting version,
default = 0
:type versionFlags: int
"""

@staticmethod
def from_dict(d: Dict) -> "UserOptions":
"""
_summary_
Static method returning initialized UserOptions class from a dictionary. This helps with the original JSON parsing.
:param d: _description_
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
:return: _description_
:return: Returns an initialized UserOptions class.
:rtype: UserOptions
"""
return UserOptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@
from src.dataset.replay_data.replay_parser.game_events.game_event import GameEvent




class GameEventsParser:
@staticmethod
def from_dict(d: Dict) -> GameEvent:
"""
Static method returning initialized GameEventsParser class from a dictionary. This helps with the original JSON parsing.
Static method returning initialized GameEvent class from a dictionary. This helps with the original JSON parsing.
:param d: Specifies a dictionary as available in the JSON file that is a result of pre-processing some .SC2Replay file.
:type d: Dict
Expand Down
2 changes: 1 addition & 1 deletion src/dataset/replay_data/replay_parser/header/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Header:
:param elapsedGameLoops: Specifies how much game loops (game-engine ticks) the game lasted.
:type elapsedGameLoops: int
:param version: Specifies the game version that was used to play the game.
:param version: Specifies the game version that players have used to play the game.
:type version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GameOptions:
:type advancedSharedControl: bool
:param amm: Specifies if AMM (AutoMM - Automated Match Making) is enabled
:type amm: bool
:param battleNet: Specifies if game was played on Battle.net
:param battleNet: Specifies if game has been played on Battle.net
:type battleNet: bool
:param clientDebugFlags: Specifies the client debug flag
:type clientDebugFlags: int
Expand Down Expand Up @@ -44,7 +44,7 @@ def from_dict(d: Dict[str, Any]) -> "GameOptions":
:param d: Describes a dictionary, it holds translations of a phrase or sentence
:type d: Dict[str, Any]
:return: Specifies a list of parameters about the game like a number of observers, fog of the game, if game was
:return: Specifies a list of parameters about the game like a number of observers, fog of the game, if the game was
competitive etc.
:rtype: GameOptions
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
MessageEvent,
)

# TODO: Docstrings


class Chat(MessageEvent):

"""
_summary_
Chat holds information about messages between players during the game
:param id: Specifies id of the chat event
:type id: int
Expand All @@ -28,7 +26,7 @@ class Chat(MessageEvent):
@staticmethod
def from_dict(d: Dict) -> "Chat":
"""
_summary_
Static method returning initialized Chat class from a dictionary. This helps with the original JSON parsing.
:param d: Specifies a dictionary, it holds translations of a phrase or sentence.
:type d: Dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from typing import Dict, Literal




class MessageEvent(metaclass=abc.ABCMeta):
@classmethod
def __subclasshook__(cls, subclass: type) -> Literal[True] | NotImplementedType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MessageEventsParser:
@staticmethod
def from_dict(d: Dict) -> MessageEvent:
"""
Static method returning initialized Header class from a dictionary. This helps with the original JSON parsing.
Static method returning initialized MessageEvent class from a dictionary. This helps with the original JSON parsing.
:param d: Specifies a dictionary, it holds translations of a phrase or sentence.
:type d: Dict
Expand Down
Loading

0 comments on commit 5298ac0

Please sign in to comment.