Commit 694f9d9e authored by Valentin Le Gauche's avatar Valentin Le Gauche
Browse files

Merge branch '28-corriger-la-syntaxe-des-attributs-des-getters-et-de-ssetters' into 'master'

Resolve "Corriger la syntaxe des attributs, des getters et de ssetters"

Closes #28

See merge request tx-techno-num/impactometre!24
parents 11823a33 ad534cfe
......@@ -3,16 +3,78 @@
export default class DistributedDamage {
/**
* Create a damage synthesis for a given damage category
* shared among tht three meeting impact categories.
* @param {Number} total - The total damage value.
* @param {Number} transportShare - The transport share.
* @param {Number} hardwareShare - The hardware share.
* @param {Number} softwareShare - The software share.
* shared among the three meeting impact categories.
* @param {Number} total - The total damage value (transport share + hardware share + software share).
* @param {Number} transportShare - The transport damage share.
* @param {Number} hardwareShare - The hardware damage share.
* @param {Number} softwareShare - The software damage share.
*/
constructor (total, transportShare, hardwareShare, softwareShare) {
this.total = total
this.transportShare = transportShare
this.hardwareShare = hardwareShare
this.softwareShare = softwareShare
this._total = total
this._transportShare = transportShare
this._hardwareShare = hardwareShare
this._softwareShare = softwareShare
}
// Getters
/**
* Getter of the total damage value (transport share + hardware share + software share).
*/
get total () {
return this._total
}
/**
* Getter of the transport damage share.
*/
get transportShare () {
return this._transportShare
}
/**
* Getter of the hardware damage share.
*/
get hardwareShare () {
return this._hardwareShare
}
/**
* Getter of the software damage share.
*/
get softwareShare () {
return this._softwareShare
}
// Setters
/**
* Setter of the total damage value (transport share + hardware share + software share).
*/
set total (total) {
this._total = total
}
/**
* Setter of the transport damage share.
*/
set transportShare (transportShare) {
this._transportShare = transportShare
}
/**
* Setter of the hardware damage share.
*/
set hardwareShare (hardwareShare) {
this._hardwareShare = hardwareShare
}
/**
* Setter of the software damage share.
*/
set softwareShare (softwareShare) {
this._softwareShare = softwareShare
}
// Other methods
}
......@@ -3,19 +3,81 @@
class MeetingDamage {
/**
* Create a damage synthesis of a meeting.
* Each value is between 1 and 100 and is composed of a transport share,
* Each value is between 1 and 100 percent and is composed of a transport share,
* a hardware share and a software share.
* @param {DistributedDamage} humanHealth - The damage value on Human Health
* @param {DistributedDamage} humanHealth - The damage value on Human Health.
* @param {DistributedDamage} ecosystemQuality - The damage value on Ecosystem Quality.
* @param {DistributedDamage} climateChange - The damage value on Climate Change.
* @param {DistributedDamage} resources - The damage value on Resources.
*/
constructor (humanHealth, ecosystemQuality, climateChange, resources) {
this.humanHealth = humanHealth
this.ecosystemQuality = ecosystemQuality
this.climateChange = climateChange
this.resources = resources
this._humanHealth = humanHealth
this._ecosystemQuality = ecosystemQuality
this._climateChange = climateChange
this._resources = resources
}
// Getters
/**
* Getter of the damage value on Human Health.
*/
get humanHealth () {
return this._humanHealth
}
/**
* Getter of the damage value on Ecosystem Quality.
*/
get ecosystemQuality () {
return this._ecosystemQuality
}
/**
* Getter of the damage value on Climate Change.
*/
get climateChange () {
return this._climateChange
}
/**
* Getter of the damage value on Resources.
*/
get resources () {
return this._resources
}
// Setters
/**
* Setter of the damage value on Human Health.
*/
set humanHealth (humanHealth) {
this._humanHealth = humanHealth
}
/**
* Setter of the damage value on Ecosystem Quality.
*/
set ecosystemQuality (ecosystemQuality) {
this._ecosystemQuality = ecosystemQuality
}
/**
* Setter of the damage value on Climate Change.
*/
set climateChange (climateChange) {
this._climateChange = climateChange
}
/**
* Setter of the damage value on Resources.
*/
set resources (resources) {
this._resources = resources
}
// Other methods
}
module.exports = MeetingDamage
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment