infect-frontend
Version:
infect fronend
33 lines (26 loc) • 674 B
JavaScript
import {observable, action, computed} from 'mobx';
class Resistance {
sampleSize = Math.round(Math.random() * 500);
resistance = Math.random();
_id;
x = 50;
y = 50;
radius = 10;
constructor(id, stage) {
this._id = id;
this._stage = stage;
}
move() {
this.x = Math.random() * this._stage.width;
this.y = Math.random() * this._stage.height;
this.radius = Math.random() * 20;
//console.log('Resistance: Moved %d to %d/%d', this._id, this.x, this.y);
}
get id() {
return this._id;
}
set id(id) {
throw new Error('nope');
}
}
export default Resistance;