Commit 26940bac authored by Clement Brizard's avatar Clement Brizard
Browse files

feat: handle embodied assimilated to another one in Hardware class

parent 19a5bca6
......@@ -37,7 +37,11 @@ class Hardware extends Component {
this._size = size
this._shareForVisio = shareForVisio
this._isSizeDependent = json.isSizeDependent
this._embodied = json.embodied
this._embodied = (json.embodiedAssimilatedTo)
? hardwareDatabase[json.embodiedAssimilatedTo.embodied]
: json.embodied
this._operatingOneMinVisio = json.operatingOneMinVisio
this._operatingOneMinStandby = json.operatingOneMinStandby
this._lifetime = json.lifetime
......@@ -94,6 +98,16 @@ class Hardware extends Component {
return this._size
}
/**
* Get the optional weight. Useful if the embodied
* damage is assilimated to the damage of 1g of another
* hardware.
* @returns {Number} The optional weight.
*/
get weight () {
return this._weight
}
/**
* Get the hardware share dedicated to visio.
* E.g. if the hardware is a laptop, the user
......@@ -115,6 +129,15 @@ class Hardware extends Component {
return this._isSizeDependent
}
/**
* Get the optional hardware name to which the current
* hardware's embodied damage is assimilated to.
* @see hardware.js in database
*/
get embodiedAssimilatedTo () {
return this._embodiedAssimilatedTo
}
/**
* Get the embodied damage info for the hardware.
* It's a raw JSON that may contain upper and lower
......
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