projet-clicodrome/js/technologie.js
2024-11-21 12:07:45 +01:00

23 lines
No EOL
540 B
JavaScript

class Technologie{
constructor(nom) {
this.nom = nom
}
charger_depuis_bdd(){
fetch("../bdd/arbre.json").then((data)=>{
data.json().then((data)=>{
console.log(data)
this.props = data["technologies"][this.nom]
this.cout = this.props.cout
this.boost = this.props.boost
})
})
}
appliquer_amelioration_style(){
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
}
}