projet-clicodrome/js/technologie.js
2024-11-29 08:50:19 +01:00

28 lines
No EOL
673 B
JavaScript

class Technologie{
constructor(nom) {
this.nom = nom
}
chargerDepuisBdd( style){
fetch("../bdd/arbre.json").then((data)=>{
data.json().then((data)=>{
console.log("clé dans technologie :",this.nom)
this.props = data["technologies"][this.nom]
this.cout = this.props.cout
this.boost = this.props.boost
if(style){
this.appliquerAmeliorationStyle()
}
})
})
}
appliquerAmeliorationStyle(){
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
}
}