forked from DaCoolOne/asciidots_compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.py
65 lines (38 loc) · 912 Bytes
/
runner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from pathtracer import path_tracer
from mapper import map
class QueuePoint:
def __init__(self, t, id):
self.time = t
self.id = id
self.next = None
class ControlQueue:
def __init__(self):
self.start = None
def insert(self, qp):
p = self.start
while not p.next is None or p.next.time > qp.time:
p = p.next
n = p.next
p.next = qp
qp.next = n
def pop(self):
n = self.start
if n is None:
return None
self.start = n.next
return n
# Assumes that the file exists. Creates the file and runs it.
class Compiler:
def __init__(self, file_name):
m = map("script.dots")
self.path_tracer = path_tracer(m)
# Initializes the enviroment
def initialize(self):
self.control_queue = ControlQueue()
for id in path_trace.init_paths:
self.control_queue.append()
def step(self):
pass
def run(self, x, y):
while not self.step():
pass