本文整理汇总了Python中Character.Character.set_attribute方法的典型用法代码示例。如果您正苦于以下问题:Python Character.set_attribute方法的具体用法?Python Character.set_attribute怎么用?Python Character.set_attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character.Character
的用法示例。
在下文中一共展示了Character.set_attribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Character import Character [as 别名]
# 或者: from Character.Character import set_attribute [as 别名]
class Controller:
"""description of class"""
def __init__(self):
self.__char = Character()
# self.__char.setRandomStats()
self.settings = Settings()
self.datasets = {}
self.max_cpoints = 60
self.max_opoints = 50
self.money = 2500
self.datasets["headers"] = []
def save(self):
prime_motivation = self.datasets["Prime Motivation: "].var.get()
most_v_person = self.datasets["Most valued person: "].var.get()
most_v_pos = self.datasets["Most valued posession: "].var.get()
valued_people = self.datasets["How do you feel about most people: "].var.get()
inmode = self.datasets["Inmode:"].var.get()
exmode = self.datasets["Exmode:"].var.get()
quirk_value_dictionary = self.datasets["Quirks"].stringvars
disorder_value_dictionary = self.datasets["Disorders"].stringvars
phobia_value_dictionary = self.datasets["Phobias"].stringvars
hair_value_dictionary = self.datasets["Hair"].stringvars
clothes_value_dictionary = self.datasets["Clothes"].stringvars
affe_value_dictionary = self.datasets["Affections"].stringvars
quirk_array = []
disorder_array = []
phobia_array = []
hair_array = []
clothes_array = []
affe_array = []
for key, value in quirk_value_dictionary.items():
try:
if value.get() != "off":
quirk_array.append(value.get())
except Exception:
if value != "off":
quirk_array.append(value)
for key, value in disorder_value_dictionary.items():
try:
if value.get() != "off":
disorder_array.append(value.get())
except Exception:
if value != "off":
disorder_array.append(value)
for key, value in phobia_value_dictionary.items():
try:
if value.get() != "off":
phobia_array.append(value.get())
except Exception:
if value != "off":
phobia_array.append(value)
for key, value in hair_value_dictionary.items():
try:
if value.get() != "off":
hair_array.append(value.get())
except Exception:
if value != "off":
hair_array.append(value)
for key, value in clothes_value_dictionary.items():
try:
if value.get() != "off":
clothes_array.append(value.get())
except Exception:
if value != "off":
clothes_array.append(value)
for key, value in affe_value_dictionary.items():
try:
if value.get() != "off":
affe_array.append(value.get())
except Exception:
if value != "off":
affe_array.append(value)
self.__char.set_attribute("player", self.datasets["player"].get())
self.__char.set_attribute("First name", self.datasets["first name"].get())
self.__char.set_attribute("Second name", self.datasets["second name"].get())
self.__char.set_attribute("Last name", self.datasets["last name"].get())
self.__char.set_attribute("Alias", self.datasets["alias"].get())
self.__char.set_attribute("age", self.datasets["age"].get())
self.__char.set_attribute("family rank", self.datasets["Family rank"].var.get())
self.__char.set_attribute("parents", self.datasets["Your parents were"].var.get())
self.__char.set_attribute("parent status", self.datasets["Parent status"].var.get())
self.__char.set_attribute("parent event", self.datasets["Parent event"].var.get())
self.__char.set_attribute("family status", self.datasets["Family status"].var.get())
#.........这里部分代码省略.........