-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from dev-ruby/dev
Separate model classes
- Loading branch information
Showing
33 changed files
with
743 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from .apex_profile import ApexProfile | ||
from .apex_query_data import ApexQueryData | ||
from .apex_segment import ApexSegment | ||
from .apex_stats import ApexStats | ||
|
||
__all__ = ["ApexProfile", "ApexQueryData", "ApexSegment", "ApexStats"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from TrackerGG.Models.General import PlatformInfo, UserInfo | ||
from .apex_segment import ApexSegment | ||
|
||
__all__ = ["ApexProfile"] | ||
|
||
|
||
class ApexProfile: | ||
def __init__(self, data: Dict[str, Any]): | ||
segments = [] | ||
for seg in data["segments"]: | ||
segments.append(ApexSegment(seg)) | ||
|
||
self.platform_info: PlatformInfo = PlatformInfo(data["platformInfo"]) | ||
self.user_info: UserInfo = UserInfo(data["userInfo"]) | ||
self.segments: List[ApexSegment] = segments | ||
self.expiry_date: str = data["expiryDate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
from typing import * | ||
|
||
__all__ = ["ApexQueryData"] | ||
|
||
|
||
class ApexQueryData: | ||
def __init__(self, data: Dict[str, Optional[Union[str, int]]]): | ||
self.platform_id: int = int(data["platformId"]) | ||
self.platform_slug: str = data["platformSlug"] | ||
self.platform_user_identifier: str = data["platformUserIdentifier"] | ||
self.platform_user_id: str = data["platformUserId"] | ||
self.platform_user_handle: str = data["platformUserHandle"] | ||
self.avatar_url: Optional[str] = data["avatarUrl"] | ||
self.status: Optional[str] = data["status"] | ||
self.additional_parameters: Optional[str] = data["additionalParameters"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from .apex_stats import ApexStats | ||
|
||
__all__ = ["ApexSegment"] | ||
|
||
|
||
class ApexSegment: | ||
def __init__(self, data: Dict[str, Union[str, dict]]): | ||
self.type: str = data["type"] | ||
self.attributes: dict = data["attributes"] | ||
self.metadata: dict = data["metadata"] | ||
self.expiry_date: str = data["expiryDate"] | ||
self.stats: ApexStats = ApexStats(data["stats"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from TrackerGG.Models.General import Stat | ||
|
||
__all__ = ["ApexStats"] | ||
|
||
|
||
class ApexStats: | ||
def __init__(self, data: Dict[str, dict]): | ||
self.level: Optional[Stat] = Stat(data.get("level")) | ||
self.kills: Optional[Stat] = Stat(data.get("kills")) | ||
self.kills_per_match: Optional[Stat] = Stat(data.get("killsPerMatch")) | ||
self.winning_kills: Optional[Stat] = Stat(data.get("winningKills")) | ||
self.kills_as_kill_leader: Optional[Stat] = Stat(data.get("killsAsKillLeader")) | ||
self.damage: Optional[Stat] = Stat(data.get("damage")) | ||
self.matches_played: Optional[Stat] = Stat(data.get("matchesPlayed")) | ||
self.revives: Optional[Stat] = Stat(data.get("revives")) | ||
self.sniper_kills: Optional[Stat] = Stat(data.get("sniperKills")) | ||
self.rank_score: Optional[Stat] = Stat(data.get("rankScore")) | ||
self.arena_rank_score: Optional[Stat] = Stat(data.get("arenaRankScore")) | ||
self.beast_of_the_hunt_kills: Optional[Stat] = Stat(data.get("beastOfTheHuntKills")) | ||
self.grapple_travel_distance: Optional[Stat] = Stat(data.get("grappleTravelDistance")) | ||
self.voices_warnings_heard: Optional[Stat] = Stat(data.get("voicesWarningsHeard")) | ||
self.voices_warnings_heard: Optional[Stat] = Stat(data.get("voicesWarningsHeard")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from .csgo_map import CSGOMap | ||
from .csgo_map_segment import CSGOMapSegment | ||
from .csgo_map_stats import CSGOMapStats | ||
from .csgo_profile import CSGOProfile | ||
from .csgo_query_data import CSGOQueryData | ||
from .csgo_segment import CSGOSegment | ||
from .csgo_stats import CSGOStats | ||
from .csgo_weapon import CSGOWeapon | ||
from .csgo_weapon_segment import CSGOWeaponSegment | ||
from .csgo_weapon_stats import CSGOWeaponStats | ||
|
||
__all__ = [ | ||
"CSGOMap", | ||
"CSGOMapSegment", | ||
"CSGOMapStats", | ||
"CSGOProfile", | ||
"CSGOQueryData", | ||
"CSGOSegment", | ||
"CSGOStats", | ||
"CSGOWeapon", | ||
"CSGOWeaponSegment", | ||
"CSGOWeaponStats", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from .csgo_map_stats import CSGOMapStats | ||
|
||
__all__ = ["CSGOMap"] | ||
|
||
|
||
class CSGOMap: | ||
def __init__(self, data: Dict[str, Union[str, dict]]): | ||
self.attributes: dict = data["attributes"] | ||
self.metadata: dict = data["metadata"] | ||
self.expiry_date: str = data["expiryDate"] | ||
self.stats: CSGOMapStats = CSGOMapStats(data["stats"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from .csgo_map_stats import CSGOMapStats | ||
|
||
__all__ = ["CSGOMapSegment"] | ||
|
||
|
||
class CSGOMapSegment: | ||
def __init__(self, data: Dict[str, Union[str, dict]]): | ||
self.type: str = data["type"] | ||
self.attributes: dict = data["attributes"] | ||
self.metadata: dict = data["metadata"] | ||
self.expiry_date: str = data["expiryDate"] | ||
self.stats: CSGOMapStats = CSGOMapStats(data["stats"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Copyright (c) 2023 DevRuby | ||
MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
""" | ||
|
||
from typing import * | ||
|
||
from TrackerGG.Models.General import Stat | ||
|
||
__all__ = ["CSGOMapStats"] | ||
|
||
|
||
class CSGOMapStats: | ||
def __init__(self, data: Dict[str, dict]): | ||
self.rounds: Stat = Stat(data["rounds"]) | ||
self.wins: Stat = Stat(data["wins"]) |
Oops, something went wrong.