コード例 #1
0
 def get(self):
     AttributeType.create('health',
                          color='#beb',
                          order=0.0,
                          recovery="0.1",
                          decay="1.0",
                          description='the state of your health. 0 means death!')
     AttributeType.create('energy',
                          color='#bbe',
                          order=1.0,
                          recovery="0.5",
                          decay="1.0",
                          description='most actions require energy to perform')
コード例 #2
0
    def __init__(self, player):
        self.player = player

        self.attribute_types = {}
        cache_key = "AttributeType.all()"
        all_attr_types = instance_cache.get(cache_key)
        if not all_attr_types:
            all_attr_types = AttributeType.all().fetch(1000)
            instance_cache.set(cache_key, all_attr_types)
        for attribute_type in all_attr_types:
            self.attribute_types[attribute_type.name] = attribute_type

        self.update()
コード例 #3
0
 def get(self):
     ats = AttributeType.all().fetch(1000)
     for at in ats:
         at.recovery="1.0"
         at.decay="2.0"
         at.put()