start rebuilding tmp_* in MVC format, first, model

This commit is contained in:
Jon Dowland 2008-02-03 16:46:51 +00:00
parent 5efaa7e2be
commit a2ac1d5777
2 changed files with 64 additions and 1 deletions

26
tools/cleanroom/doom.py Normal file
View file

@ -0,0 +1,26 @@
"""A module for manipulating Doom data structures."""
class Patch:
def __init__(self, n,x,y):
self.name = n
self.yoff = x
self.xoff =y
def __str__(self):
return "*\t%8s\t\t%d\t%d" % (self.name,self.xoff,self.yoff)
class Texture:
def __init__(self,name,width,height):
self.name = name
self.width = width
self.height = height
self.patches = []
self.pixbuf = None
def __str__(self):
me = "%8s\t\t%d\t%d\n" % (self.name,int(self.width),int(self.height))
kids = "\n".join(map(str, self.patches))
if kids:
kids += "\n"
return (me + kids)