Removed cruft
This commit is contained in:
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user