mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-24 19:49:52 +02:00
mk_battle_modes(): helper for Battle modes
This commit is contained in:
1 parent
b3f5c50318
commit
3eb2714534
1 file changed
+30
-3
+30
-3
@@ -91,15 +91,41 @@ def def_value_BattleRecord():
|
|||||||
return BattleRecord()
|
return BattleRecord()
|
||||||
|
|
||||||
class BattleRecordCategory():
|
class BattleRecordCategory():
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def mk_battle_modes(modes: dict):
|
||||||
|
"""Make a list of battle modes as required for the _result_categories"""
|
||||||
|
mode_ids = modes.values()
|
||||||
|
id_max = max(mode_ids)
|
||||||
|
ret_modes = ['-'] * (id_max+16) # create a list of '-' elements
|
||||||
|
|
||||||
|
for mode in modes:
|
||||||
|
id = modes[mode]
|
||||||
|
ret_modes[id] = mode
|
||||||
|
|
||||||
|
return ret_modes
|
||||||
|
|
||||||
|
_battle_modes = {
|
||||||
|
'Any' : 0,
|
||||||
|
'Random' : 1,
|
||||||
|
'Training Room' : 2,
|
||||||
|
'Tournament' : 4,
|
||||||
|
'Rating' : 7,
|
||||||
|
'Mad Games' : 8,
|
||||||
|
'Realistic Battles' : 22,
|
||||||
|
'Gravity Mode' : 24,
|
||||||
|
'Burning Games' : 26
|
||||||
|
}
|
||||||
|
|
||||||
|
_BATTLE_MODES = mk_battle_modes.__func__(_battle_modes)
|
||||||
|
|
||||||
_result_categories = {
|
_result_categories = {
|
||||||
'total' : [ 'TOTAL', 'total' ],
|
'total' : [ 'TOTAL', 'total' ],
|
||||||
'battle_result' : [ 'Result', [ 'Loss', 'Win', 'Draw']],
|
'battle_result' : [ 'Result', [ 'Loss', 'Win', 'Draw']],
|
||||||
'battle_type' : [ 'Battle Type', ['Encounter', 'Supremacy']],
|
'battle_type' : [ 'Battle Type', ['Encounter', 'Supremacy']],
|
||||||
'tank_tier' : [ 'Tank Tier', 'number' ],
|
'tank_tier' : [ 'Tank Tier', 'number' ],
|
||||||
'top_tier' : [ 'Tier', ['Bottom tier', 'Top tier']],
|
'top_tier' : [ 'Tier', ['Bottom tier', 'Top tier']],
|
||||||
'room_type' : [ 'Battle Mode', ['Any', 'Random', 'Training Room', '-', 'Tournament', '-', '-', 'Rating', 'Mad Games', '-', \
|
'room_type' : [ 'Battle Mode', _BATTLE_MODES ],
|
||||||
'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', \
|
|
||||||
'-', '-','Realistic Battles', '-', 'Gravity Mode', '-', 'Burning Games', '-', '-', '-'] ],
|
|
||||||
'mastery_badge' : [ 'Battle Medal', ['-', '3rd Class', '2nd Class', '1st Class', 'Mastery' ]],
|
'mastery_badge' : [ 'Battle Medal', ['-', '3rd Class', '2nd Class', '1st Class', 'Mastery' ]],
|
||||||
'team_result' : [ 'Team Result', 'string' ],
|
'team_result' : [ 'Team Result', 'string' ],
|
||||||
'map_name' : [ 'Map', 'string' ],
|
'map_name' : [ 'Map', 'string' ],
|
||||||
@@ -132,6 +158,7 @@ class BattleRecordCategory():
|
|||||||
|
|
||||||
RESULT_CAT_FRMT = '{:>20s}'
|
RESULT_CAT_FRMT = '{:>20s}'
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_default_categories(cls):
|
def get_default_categories(cls):
|
||||||
return cls._result_categories_default
|
return cls._result_categories_default
|
||||||
|
|||||||
Reference in new issue
Block a user