From 8386ae0e63313ffc5d0fefebda8451d982679e01 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 25 Aug 2015 17:30:58 +0200 Subject: process.frame() in stats.py, no functional changes --- main.py | 6 +++--- stats.py | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 69a9499..08793d3 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,7 @@ from strategy import * sub = EnhancingSubscriber() c = client.Client(sub) sub.set_client(c) -stats = stats.Stats() +stats = stats.Stats(c) try: nick = sys.argv[2] @@ -69,8 +69,8 @@ while True: if gui.bot_input: c.send_target(target[0], target[1]) - stats.log_pos(c.player.center) - stats.log_mass(c.player.total_mass) + stats.process_frame() + gui.update() if not c.player.is_alive: diff --git a/stats.py b/stats.py index f850339..9a745ab 100644 --- a/stats.py +++ b/stats.py @@ -1,7 +1,8 @@ import time class Stats: - def __init__(self): + def __init__(self,c): + self.c = c self.min_mass = 0 self.max_mass = 0 self.current_mass = 0 @@ -33,4 +34,8 @@ class Stats: self.cell_defensiveness[cell] = value def get_last_steps(self, list, steps = 10): - return list[-steps:] \ No newline at end of file + return list[-steps:] + + def process_frame(self): + self.log_pos(self.c.player.center) + self.log_mass(self.c.player.total_mass) -- cgit v1.2.3