浏览代码

Do not store unit specification in unit object

Tankernn 7 年之前
父节点
当前提交
741f07e8cf
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      citybuilder/player.py

+ 3 - 3
citybuilder/player.py

@@ -5,8 +5,8 @@ from citybuilder import core
 
 
 class Unit:
-    def __init__(self, spec, level):
-        self.spec = spec
+    def __init__(self, key, level):
+        self.type = key
         self.level = level
 
 
@@ -21,7 +21,7 @@ class Job:
             if self.product['type'] == "building":
                 self.player.buildings[self.product['name']] += 1
             elif self.product['type'] == "unit":
-                self.player.units.append(Unit(self.product['spec'], self.product['level']))
+                self.player.units.append(Unit(self.product['name'], self.product['level']))
             return True
         return False