class Marine {
constructor(_damage, _armor) {
this.damage = _damage;
this.armor = _armor;
}
get damage() { return this.damage; }
set damage(value) { this.damage = value; }
get armor() { return this.armor; }
set armor(value) { this.armor = value; }
}
let marine = new Marine(10, 5);
alert(marine.damage)
marine.damage = 20;
alert(marine.damage)
class Marine {
constructor(_damage, _armor) {
this.damage_g = _damage;
this.armor_g = _armor;
}
get damage() { return this.damage_g; }
set damage(value) { this.damage_g = value; }
get armor() { return this.armor_g; }
set armor(value) { this.armor_g = value; }
}
let marine = new Marine(10, 5);
alert(marine.damage_g)
marine.damage_g = 20;
alert(marine.damage_g)