public ActionClick.State Develope() { if (this.state.Equals(ActionClick.State.Activated)) { this.state = ActionClick.State.InDevelopement; } return(this.state); }
public ActionClick.State Activate() { if (this.state.Equals(ActionClick.State.Deactivated)) { this.state = ActionClick.State.Activated; } return(this.state); }
public void DevelopTick() { if (this.start <= this.days) { this.start += 1; } else { Game.play.AddNews(new News("Action developed", "The development of " + this.name + " is finished!", NewsType.Action)); this.state = ActionClick.State.Developed; } }
public Action(int id, string name, int development, Category category, double price, int points, string descr, string img, LinkedList <Effect> effects, int[] needs) { this.id = id; this.name = name; this.development = development; this.category = category; this.price = price; this.points = points; this.descr = descr; this.img = img; this.effects = effects; this.needs = needs; this.state = ActionClick.State.Deactivated; this.start = 0; this.days = development * 30; }
public bool Unlocked(int[] developed) { bool o = true; foreach (int n in this.needs) { bool i = false; foreach (int a in developed) { if (!i) { i = (n == a); } } o = (o && i); } Debug.Log("Unlocked: " + this.name + " with: " + o + " and needs.l: " + this.needs.Length); if (o && (this.state.Equals(ActionClick.State.Deactivated))) { this.state = ActionClick.State.Activated; } return(o); }
public void ChangeState(ActionClick.State state) { this.state = state; }