changed MCLevel.size into a property.

This commit is contained in:
David Vierra 2010-10-23 17:26:26 -10:00
parent ead880dcc3
commit 4f157e5b17

View File

@ -322,9 +322,6 @@ class MCLevel(object):
players = ["Player"] players = ["Player"]
@classmethod @classmethod
def getWorldBounds(self):
return BoundingBox( (0,0,0), self.getSize() )
def isLevel(cls, filename): def isLevel(cls, filename):
"""Tries to find out whether the given filename can be loaded """Tries to find out whether the given filename can be loaded
by this class. Returns True or False. by this class. Returns True or False.
@ -350,9 +347,13 @@ class MCLevel(object):
return False return False
def getSize(self): def getWorldBounds(self):
return BoundingBox( (0,0,0), self.size )
@property
def size(self):
"Returns the level's dimensions as a tuple (X,Y,Z)"
return (self.Width, self.Height, self.Length) return (self.Width, self.Height, self.Length)
size = property(getSize, None, None, "Returns the level's dimensions as a tuple (X,Y,Z)")
def compressedSize(self): def compressedSize(self):
"return the size of the compressed data for this level, in bytes." "return the size of the compressed data for this level, in bytes."