class Player{
constructor(x,y){
this.x = x;
this.y = y;
}
set_x(x){
this.x = x;
}
set_y(y){
this.y = y;
}
get_x(){
return this.x;
}
get_y(){
return this.y;
}
updatePlayer(x, y){
this.set_x(x);
this.set_y(y);
}
}
class Grid{
constructor(width, height){
this.width = width;
this.height = height;
this.spaces = new Array(height);
}
initialise(){
var row = new Array(this.width);
for(var index in row){
row[index] = 0;
}
for(var index1 in this.spaces){
this.spaces[index] = row.slice(0);
}
var i;
var j;
//for(i = 1; i < 19;i++){
// for(j=1; j < 19;j++ ){
// this.spaces[i][j] = 1;
// }
//}
}
}
var good = new Player(0,0);
var bad = new Player(0,0);
var grid = new Grid(20,20);
function Mind()
{
this.newRun = function(){
grid.initialise();
console.log(grid.spaces);
};
this.getAction = function( x ){
//initialise both players
good.updatePlayer(x[0],x[1]);
bad.updatePlayer(x[2],x[3]);
};
this.endRun = function(){
}
}