diff charactercreationcontroller.py @ 154:4dc7951c3bfc

Moved code from CharacterCreationController to GameModel
author KarstenBock@gmx.net
date Sat, 05 Nov 2011 14:53:12 +0100
parents 741d7d193bad
children f017f8cac2c2
line wrap: on
line diff
--- a/charactercreationcontroller.py	Sat Nov 05 14:42:12 2011 +0100
+++ b/charactercreationcontroller.py	Sat Nov 05 14:53:12 2011 +0100
@@ -17,7 +17,6 @@
 
 from parpg import vfs
 import characterstatistics as char_stats
-from serializers import XmlSerializer
 from controllerbase import ControllerBase
 from gamescenecontroller import GameSceneController
 from gamesceneview import GameSceneView
@@ -87,16 +86,6 @@
         self.view.cancel_new_game_callback = self.cancelNewGame
 
     def reset_character(self):
-        # FIXME M. George Hansen 2011-06-06: character stats scripts aren't
-        #     finished, unfortunately.
-        #primary_stats_file = \
-        #    vfs.VFS.open('character_scripts/primary_stats.xml')
-        #primary_stats = XmlSerializer.deserialize(primary_stats_file)
-        #secondary_stats_file = \
-        #    vfs.VFS.open('character_scripts/secondary_stats.xml')
-        #secondary_stats = XmlSerializer.deserialize(secondary_stats_file)        
-        primary_stats = []
-        secondary_stats = []
         inventory = []
         for x in xrange(self.INV_SLOTS):
             inventory.append(None)
@@ -109,14 +98,14 @@
         self.char_data.characterstats.picture = (
             self.PICTURES[self.GENDERS[0]][0]
         )
-        for primary_stat in primary_stats:
+        for primary_stat in self.model.primary_stats:
             long_name = primary_stat.long_name
             self.char_data.characterstats.primary_stats[long_name] = (
                 char_stats.PrimaryStatisticValue(
                     primary_stat, self.char_data.characterstats, 
                     DEFAULT_STAT_VALUE)
             )
-        for secondary_stat in secondary_stats:
+        for secondary_stat in self.model.secondary_stats:
             name = secondary_stat.name            
             self.char_data.characterstats.secondary_stats[name] = (
                 char_stats.SecondaryStatisticValue(secondary_stat,