Last active
August 29, 2015 14:20
-
-
Save JosuaKrause/30dc6f966a06e4bd6537 to your computer and use it in GitHub Desktop.
My base classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TypeBase(Object): | |
def __init__(self): | |
self.codeTypes = {} | |
def id(): | |
raise NotImplementedError() | |
def name(): | |
raise NotImplementedError() | |
def desc(self): | |
return self.name() | |
def color(): | |
raise NotImplementedError() | |
def addCodeType(self, codeType): | |
self.codeTypes[codeType.codeName()] = codeType | |
### TODO add create and init | |
class TypeCode(Object): | |
def typeId(): | |
raise NotImplementedError() | |
def codeName(): | |
raise NotImplementedError() | |
def init(self): | |
raise NotImplementedError() | |
def create(self, symbols, type, id): | |
raise NotImplementedError | |
baseTypes = {} | |
def on_TypeBase(tb): | |
baseTypes[tb.id()] = tb | |
def on_TypeCode(tc): | |
baseTypes[tc.typeId()].addCodeType(tc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment