Removed cruft

This commit is contained in:
MaxRobinsonTheGreat
2020-08-18 11:40:46 -06:00
parent 3f05fbe7f9
commit 3aa0aae4e2
8 changed files with 7 additions and 148 deletions

View File

@@ -1,18 +0,0 @@
const CellTypes = {
empty: 0,
food: 1,
wall: 2,
mouth: 3,
producer: 4,
mover: 5,
killer: 6,
armor: 7,
eye: 8,
colors: ['#121D29', 'green', 'gray', 'orange', 'white', '#3493EB', 'red', 'purple', '#d4bb3f'],
names: ['Empty', 'Food', 'Wall', 'Mouth', 'Producer', 'Mover', 'Killer', 'Armor', 'Eye'],
getRandomLivingType: function() {
return Math.floor(Math.random() * 6) + 3;
}
}
module.exports = CellTypes;

View File

@@ -1,46 +0,0 @@
const CellStates = require("./CellStates");
const Directions = require("../Directions");;
const Eye = require("../Perception/Eye.js");
// A body cell defines the relative location of the cell in it's parent organism. It also defines their functional behavior.
class LocalCell{
constructor(state, loc_col, loc_row, eye=null){
this.state = state;
this.loc_col = loc_col;
this.loc_row = loc_row;
if (this.state == CellStates.eye){
this.eye = new Eye();
if (eye != null) {
this.eye.direction = eye.direction;
}
}
}
rotatedCol(dir){
switch(dir){
case Directions.up:
return this.loc_col;
case Directions.down:
return this.loc_col * -1;
case Directions.left:
return this.loc_row;
case Directions.right:
return this.loc_row * -1;
}
}
rotatedRow(dir){
switch(dir){
case Directions.up:
return this.loc_row;
case Directions.down:
return this.loc_row * -1;
case Directions.left:
return this.loc_col * -1;
case Directions.right:
return this.loc_col;
}
}
}
module.exports = LocalCell;