diff components/character_statistics.py @ 155:f017f8cac2c2

Statistics are being saved and loaded.
author KarstenBock@gmx.net
date Sat, 05 Nov 2011 16:04:59 +0100
parents 741d7d193bad
children
line wrap: on
line diff
--- a/components/character_statistics.py	Sat Nov 05 14:53:12 2011 +0100
+++ b/components/character_statistics.py	Sat Nov 05 16:04:59 2011 +0100
@@ -38,4 +38,12 @@
         for stat in stats.primary_stats:
             if stat.statistic_type.short_name == name:
                 return stat
-    return None
\ No newline at end of file
+    return None
+
+def get_stat_values(char_stats):
+    stats = {"primary":{}, "secondary":{}}
+    for name, stat in char_stats.primary_stats.iteritems():
+        stats["primary"][name] = stat.value
+    for name, stat in char_stats.secondary_stats.iteritems():
+        stats["secondary"][name] = stat.value
+    return stats
\ No newline at end of file