-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added demonstration of battle results parsing #27
- Loading branch information
1 parent
02f3210
commit 2791745
Showing
5 changed files
with
388 additions
and
13 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
47 changes: 47 additions & 0 deletions
47
replay_unpack/clients/wows/versions/12_7_0/battle_results.py
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,47 @@ | ||
from .constants import ( | ||
COMMON_RESULTS, | ||
PLAYER_PRIVATE_RESULTS, | ||
INIT_ECONOMICS, | ||
SUBTOTAL_ECONOMICS, | ||
COMMON_ECONOMICS, | ||
CLIENT_PUBLIC_RESULTS, | ||
CLIENT_VEH_INTERACTION_DETAILS, | ||
CLIENT_BUILDING_INTERACTION_DETAILS, | ||
BUILDINGS_FULL_RESULTS | ||
) | ||
|
||
|
||
def listToDict(names, l): | ||
return dict(zip(names, l)) | ||
|
||
|
||
def unpackBuildinsRes(buildingsList): | ||
return listToDict(BUILDINGS_FULL_RESULTS, buildingsList) | ||
|
||
|
||
def unpackCommonRes(commonResults): | ||
return listToDict(COMMON_RESULTS, commonResults) | ||
|
||
|
||
def unpackPlayerPrivateRes(privateList): | ||
result = listToDict(PLAYER_PRIVATE_RESULTS, privateList) | ||
|
||
result['init_economics'] = listToDict(INIT_ECONOMICS, result['init_economics']) | ||
result['common_economics'] = listToDict(COMMON_ECONOMICS, result['common_economics']) | ||
result['subtotal_economics'] = listToDict(SUBTOTAL_ECONOMICS, result['subtotal_economics']) | ||
return result | ||
|
||
|
||
def unpackClientPublicRes(publicList): | ||
result = listToDict(CLIENT_PUBLIC_RESULTS, publicList) | ||
|
||
result['interactions'] = { | ||
targetId: listToDict(CLIENT_VEH_INTERACTION_DETAILS, data) | ||
for targetId, data in result['interactions'].items() | ||
} | ||
result['buildingInteractions'] = { | ||
targetId: listToDict(CLIENT_BUILDING_INTERACTION_DETAILS, data) | ||
for targetId, data in result['buildingInteractions'].items() | ||
} | ||
|
||
return result |
Oops, something went wrong.