Update attributeManager.py

This commit is contained in:
chrys87 2018-05-28 10:32:13 +02:00 committed by GitHub
parent b2dd754d15
commit 3f5e3689fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,10 @@ class attributeManager():
def __init__(self): def __init__(self):
self.currAttributes = None self.currAttributes = None
self.prevAttributes = None self.prevAttributes = None
self.currAttribDelta = ''
self.prevAttribDelta = ''
self.currAttribCursor = None
self.prefAttribCursor = None
self.setDefaultAttributes() self.setDefaultAttributes()
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
@ -19,6 +23,14 @@ class attributeManager():
def updateAttributeData(self, prevAttributes, currAttributes): def updateAttributeData(self, prevAttributes, currAttributes):
self.prevAttributes = prevAttributes self.prevAttributes = prevAttributes
self.currAttributes = currAttributes self.currAttributes = currAttributes
def getAttributeByXY(self, x, y):
if not self.currAttributes:
return None
if len(self.currAttributes) < y:
return None
if len(self.currAttributes[y]) < x:
return None
return self.currAttributes[y][x]
def setDefaultAttributes(self): def setDefaultAttributes(self):
self.defaultAttributes = [] self.defaultAttributes = []
self.defaultAttributes.append(( self.defaultAttributes.append((