Beispiel #1
0
 def getforsaleminusplayer(self, player = None):
     if not player:
         currentplayer = doo.getcurrentplayer()
     else:
         currentplayer = player
     if currentplayer:
         playerstuff = currentplayer.getplayerstuffbystuffid(self.stuffid)
         if playerstuff:
             amountforsale = self.forsale - playerstuff.forsale
             return amountforsale
         else:
             return self.forsale
     else: #hopefully this will never be called
         return self.forsale
Beispiel #2
0
 def setforsale(self, forsale):
     if self.ownerid != doo.getcurrentplayer().playerid:
         return None
     self.forsale = forsale
     self.put()
Beispiel #3
0
 def setprice(self, price):
     price = float(float(price))
     if self.ownerid != doo.getcurrentplayer().playerid:
         return None
     self.price = price
     self.put()