-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLifeCycler.py
More file actions
47 lines (29 loc) · 987 Bytes
/
LifeCycler.py
File metadata and controls
47 lines (29 loc) · 987 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
45
46
'''
* LifeCycler.py
*
* Created on: 24.12.2018
* Author: Andrew Jason Bishop
*
* General description:
* xxx
'''
class LifeCycler:
def __init__(self, _space):
self.space = _space
self.cellFactory = None
self.envirCreator = None
def setCellFactory(self, _cf):
self.cellFactory = _cf
def setCreator(self, _ec):
self.envirCreator = _ec
def cellBirth(self, _deadCell):
deadCellCoord = _deadCell.getCellCoord()
newLiveCell = self.cellFactory.createLiveCell( deadCellCoord )
self.space.placeCell( newLiveCell )
self.envirCreator.create_surrounding_DeadCells( deadCellCoord )
def cellDeath(self, _liveCell):
newDeadCell = self.cellFactory.createDeadCell( _liveCell.coord )
self.space.placeCell( newDeadCell )
def cellTermination(self, _cellToTerminate):
self.space.removeCell( _cellToTerminate.coord )
''' END '''