Files
Sheerka-Old/core/concept.py
T
2019-10-22 19:02:51 +02:00

37 lines
1.0 KiB
Python

class Concept:
"""
Default concept object
A concept is a the base object of our universe
Everything is a concept
"""
concepts_id = 0
def __init__(self, name, is_builtin=False):
self.name = name
self.is_builtin = is_builtin
self.pre = None # list of pre conditions before calling the main function
self.post = None # list of post conditions after calling the main function
self.main = None # main method, can also be the value of the concept
self.id = Concept.concepts_id
Concept.concepts_id = Concept.concepts_id + 1
self.props = [] # list of Property for this concept
self.functions = {} # list of helper functions
def __str__(self):
return f"({self.id}){self.name}"
def __repr__(self):
return f"({self.id}){self.name}"
class Property:
"""
Defines a behaviour of Concept
"""
def __init__(self, concept, value):
self.concept = concept
self.value = value