Compare commits

..

No commits in common. "36ffefcfb7c96cb7b5f1358e8e9525c1c35e01a0" and "29c674c86d594ab90d9094f3d9bfaa6768b013e7" have entirely different histories.

2 changed files with 4 additions and 25 deletions

View file

@ -1,6 +1,6 @@
function remplirMagasin(){
const table= document.getElementById("table_magasin_body")
@ -19,27 +19,10 @@ function remplirMagasin(){
const cout = document.createElement("td")
cout.innerText = el.cout
const test = document.createElement("td")
const btn_acheter = document.createElement("button")
let tmp = key
btn_acheter.addEventListener("click", (event) =>{
console.log("clé : ",tmp)
let t = new Technologie(tmp)
t.chargerDepuisBdd(true)
})
btn_acheter.innerText = "Acheter"
test.appendChild(btn_acheter)
tr.appendChild(nom)
tr.appendChild(boost)
tr.appendChild(cout)
tr.appendChild(test)
table.appendChild(tr)
});
})
@ -48,3 +31,4 @@ function remplirMagasin(){
}

View file

@ -3,20 +3,15 @@ class Technologie{
this.nom = nom
}
chargerDepuisBdd( style){
chargerDepuisBdd(){
fetch("../bdd/arbre.json").then((data)=>{
data.json().then((data)=>{
console.log("clé dans technologie :",this.nom)
console.log(data)
this.props = data["technologies"][this.nom]
this.cout = this.props.cout
this.boost = this.props.boost
if(style){
this.appliquerAmeliorationStyle()
}
})
})
}