public void removeRessource(ressource oldRessource) { if (ressourceScripts.Contains(oldRessource)) { ressourceScripts.Remove(oldRessource); } }
public void addRessource(ressource newRessource) { if (!ressourceScripts.Contains(newRessource)) { ressourceScripts.Add(newRessource); } }
private void sousRes(ressource r1, ressource r2) { r1.bois -= r2.bois; r1.fer -= r2.fer; r1.or -= r2.or; r1.nouriture -= r2.nouriture; }
private bool compRes(ressource r1, ressource r2) { if (r1.bois >= r2.bois && r1.fer >= r2.fer && r1.or >= r2.or && r1.nouriture >= r2.nouriture) { return(true); } return(false); }
public void SpawnWorker(ressource ressourceScripts) { GameObject newWorker = (GameObject)Instantiate(workerPrefab, new Vector3(transform.position.x+2.0f, transform.position.y, transform.position.z), Quaternion.identity); WorkerScript workerScript = newWorker.GetComponent<WorkerScript>(); if(workerScript) { workerScript.initializeWorker(ressourceScripts.gameObject.GetComponent<path_point>()); } }
public void IncrementRessource(ressource res, int quantity = 1) { this.pickupSound.Play(0); if (this.ressources[res] < GetMaxRessources()) { this.ressources[res] += quantity; } }
public void clearAllAnts(ressource clearRessource) { for(int i = 0; i < workerScripts.Count; i++) { if(workerScripts[i].targetRessource == clearRessource) { workerScripts[i].retreat = true; } } }
// GET: Resource/Delete/5 public ActionResult Delete(int id) { ressource r = rs.GetById(id); r.availability = "Former Employee"; rs.Update(r); rs.Commit(); return(RedirectToAction("Index")); }
public JsonResult DeleteCustomer(int ID) { ressource r = rs.GetById(ID); r.availability = "Former Employee"; rs.Update(r); rs.Commit(); return(Json(data: "Deleted", behavior: JsonRequestBehavior.AllowGet)); }
public void clearAllAnts(ressource clearRessource) { for (int i = 0; i < workerScripts.Count; i++) { if (workerScripts[i].targetRessource == clearRessource) { workerScripts[i].retreat = true; } } }
public void SpawnWorker(ressource ressourceScripts) { GameObject newWorker = (GameObject)Instantiate(workerPrefab, new Vector3(transform.position.x + 2.0f, transform.position.y, transform.position.z), Quaternion.identity); WorkerScript workerScript = newWorker.GetComponent <WorkerScript>(); if (workerScript) { workerScript.initializeWorker(ressourceScripts.gameObject.GetComponent <path_point>()); } }
public void initializeWorker(path_point WP) { retreat = false; targetWP = WP; targetRessource = WP.GetComponent <ressource>(); currentPath = WP.path_to_base; currentPointInPath = 1; animator.SetBool("isrunning", true); GameObject.Find("ui_manager").GetComponent <ui_manager>().refresh_ressource_ui(); GameObject.Find("ui_manager").GetComponent <ui_manager>().refresh_ressource_ui_slots(); }
public void initializeWorker(path_point WP) { retreat = false; targetWP = WP; targetRessource = WP.GetComponent<ressource>(); currentPath = WP.path_to_base; currentPointInPath = 1; animator.SetBool("isrunning", true); GameObject.Find ("ui_manager").GetComponent<ui_manager>().refresh_ressource_ui(); GameObject.Find ("ui_manager").GetComponent<ui_manager>().refresh_ressource_ui_slots(); }
private void UpdateRessourceText(ressource res, Text txt, string msg) { txt.text = boardBehavior.GetRessource(res) + msg; if (boardBehavior.GetRessource(res) < boardBehavior.GetMaxRessources()) { txt.color = normalColor; } else { txt.color = fullColor; } }
public void collectStuff(Transform t) { ressource ressource = t.GetComponent <ressource>(); if (ressource != null) { bool ok = inventory.AddToSlots(ressource.item); if (ok) { asteroidBelt.DeleteItem(t); } //Destroy(t.gameObject); } }
public game() { pop = 0; pop_dispo = 0; for (int i = 0; i < 100; i++) { bat.Add(new batiment(0)); } prestige = 0; nataliter = 0.005; bonheur = 0; technologie = 0; population_max = 0; res_base = new ressource(100, 100, 1000, 100); res_max = new ressource(100, 100, 1000, 100); tech = new technologie(); }
public void Init(int x, int y, ressource type) { this.posX = x; this.posY = y; this.type = ressource.CLAY; this.type = type; switch (this.type) { case ressource.DIRT: SetMaterial(matDirt); break; case ressource.CLAY: SetMaterial(matClay); break; case ressource.STICK: SetMaterial(matStick); break; case ressource.BRICK: SetMaterial(matBrick); break; case ressource.STONE: SetMaterial(matStone); break; case ressource.LEAF: SetMaterial(matLeaf); break; case ressource.FRUIT: SetMaterial(matFruit); break; } this.transform.SetPositionAndRotation( new Vector3(x, y, -0.2f), Quaternion.identity ); }
public void IncrementDay() { if (!won) { this.days += 1; if (firePitBuilding.GetLevel() > 0) { ressource clay = ressource.CLAY; int maxPossible = GetLowest(firePitBuilding.GetLevel(), GetRessource(clay)); UseRessource(clay, maxPossible); IncrementRessource(ressource.BRICK, maxPossible); } if (kitchenBuilding.GetLevel() > 0) { ressource fruit = ressource.FRUIT; int maxPossible = GetLowest(kitchenBuilding.GetLevel(), GetRessource(fruit)); UseRessource(fruit, maxPossible); IncrementRessource(ressource.FOOD, maxPossible); } } }
public route(double prix_or) { res = new ressource(0, 0, prix_or, 0); }
public void UseRessource(ressource res, int quantity = 1) { this.ressources[res] -= quantity; }
public void addRessource(ressource newRessource) { if(!ressourceScripts.Contains(newRessource)) { ressourceScripts.Add(newRessource); } }
public gardeManger(double bois_prix, double or_prix, double fer_prix) { res = new ressource(bois_prix, fer_prix, or_prix, 0); res_max = new ressource(0, 0, 0, 50); }
public magasin(double bois_prix, double or_prix, double popo) { res = new ressource(bois_prix, 0, or_prix, 0); prod_mag = 0.5; pop = popo; }
public ecole(double bois_prix, double or_prix, double fer_prix) { res = new ressource(bois_prix, fer_prix, or_prix, 0); prod_ecole = 0.5; }
public entrepos(double bois_prix, double or_prix, double fer_prix) { res = new ressource(bois_prix, fer_prix, or_prix, 0); res_max = new ressource(50, 50, 0, 0); }
public scierie(double bois_prix, double or_prix, double popo) { pop = popo; res = new ressource(bois_prix, 0, or_prix, 0); prod_scirie = 0.5; }
public monument(double bois_prix, double or_prix, double fer_prix) { res = new ressource(bois_prix, fer_prix, or_prix, 0); }
public mine(double bois_prix, double or_prix, double popo) { res = new ressource(bois_prix, 0, or_prix, 0); prod_mine = 0.5; pop = popo; }
public int GetRessource(ressource res) { return(this.ressources[res]); }
public ferme(double bois_prix, double or_prix, double popo) { res = new ressource(bois_prix, 0, or_prix, 0); pop = popo; prod_ferme = 1.5; }
// Use this for initialization void Start() { targetRessource = GetComponent<ressource>(); }
public void removeRessource(ressource oldRessource) { if(ressourceScripts.Contains(oldRessource)) { ressourceScripts.Remove(oldRessource); } }
// Use this for initialization void Start() { targetRessource = GetComponent <ressource>(); }
public maison2(double prix_bois) { res = new ressource(prix_bois, 0, 0, 0); }