-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUniverse.py
More file actions
45 lines (28 loc) · 823 Bytes
/
Universe.py
File metadata and controls
45 lines (28 loc) · 823 Bytes
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
'''
* Universe.py
*
* Created on: 10.11.2018
* Author: Andrew Jason Bishop
*
* General description:
* xxx
'''
import Cell as cl
from Enums import *
class Universe:
def __init__(self, _space):
self.space = _space
def update(self):
coords = self.space.get_all_cellCoords()
print("cell count:", self.space.get_cell_count())
self.update_cellTransistions( coords )
self.update_cellTypes( coords )
def update_cellTransistions(self, _coords):
for coord in _coords:
cell = self.space.getCell( coord )
cell.update_transition()
def update_cellTypes(self, _coords):
for coord in _coords:
cell = self.space.getCell( coord )
cell.update_type()
''' END '''