From 80d87ee2306f8b9693e74ca3c229c619bea8d74f Mon Sep 17 00:00:00 2001 From: Wiktor Mazur Date: Thu, 12 Mar 2020 20:33:59 +0100 Subject: [PATCH] GUI : all by default --- application/src/engine.py | 17 ++++++++--------- application/src/gui/modules/main.py | 12 +++--------- application/src/gui/modules/view_type.py | 1 - 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/application/src/engine.py b/application/src/engine.py index 75e62dd..beb3733 100644 --- a/application/src/engine.py +++ b/application/src/engine.py @@ -107,25 +107,24 @@ class FameStat: self.fame_per_hour = fame_per_hour -def zone_stats(with_damage=False): - return get_stats(StatType.Zone, with_damage) +def zone_stats(): + return get_stats(StatType.Zone) -def overall_stats(with_damage=False): - return get_stats(StatType.Overall, with_damage) +def overall_stats(): + return get_stats(StatType.Overall) -def last_fight_stats(with_damage=False): - return get_stats(StatType.LastFight, with_damage) +def last_fight_stats(): + return get_stats(StatType.LastFight) -def get_stats(stat_type: StatType, with_damage: bool): +def get_stats(stat_type: StatType): fame = game_stats.fame_stats(stat_type) time = game_stats.time_stats(stat_type)['seconds_in_game'] fame = FameStat(Number(fame['fame']), Number( fame['fame'] / time if time > 0.0 else 0.0)) - players = list(filter(lambda p: p.value != - 0.0 if with_damage else True, game_stats.damage_stats(stat_type))) + players = game_stats.damage_stats(stat_type) return players, fame, time diff --git a/application/src/gui/modules/main.py b/application/src/gui/modules/main.py index 1cb2fe7..07cfff3 100644 --- a/application/src/gui/modules/main.py +++ b/application/src/gui/modules/main.py @@ -50,7 +50,6 @@ class ViewTypeWidget(QComboBox): def __init__(self): QComboBox.__init__(self) self.addItem(ViewType.DMG) - self.addItem(ViewType.DMG_ALL) def get_view_type(self): return self.currentText() @@ -130,14 +129,9 @@ class MainWidget(QWidget): def damage_stats(self): stats = { ViewType.DMG: { - StatsType.ZONE: functools.partial(engine.zone_stats, with_damage=True), - StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, with_damage=True), - StatsType.OVERALL: functools.partial(engine.overall_stats, with_damage=True), - }, - ViewType.DMG_ALL: { - StatsType.ZONE: functools.partial(engine.zone_stats, with_damage=False), - StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, with_damage=False), - StatsType.OVERALL: functools.partial(engine.overall_stats, with_damage=False), + StatsType.ZONE: functools.partial(engine.zone_stats), + StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats), + StatsType.OVERALL: functools.partial(engine.overall_stats), } } diff --git a/application/src/gui/modules/view_type.py b/application/src/gui/modules/view_type.py index dbc6ff6..696f9a4 100644 --- a/application/src/gui/modules/view_type.py +++ b/application/src/gui/modules/view_type.py @@ -1,3 +1,2 @@ class ViewType: DMG = 'Stats (damage)' - DMG_ALL = 'Stats (damage all)' \ No newline at end of file