コード例 #1
0
        public ActionClick.State Develope()
        {
            if (this.state.Equals(ActionClick.State.Activated))
            {
                this.state = ActionClick.State.InDevelopement;
            }

            return(this.state);
        }
コード例 #2
0
        public ActionClick.State Activate()
        {
            if (this.state.Equals(ActionClick.State.Deactivated))
            {
                this.state = ActionClick.State.Activated;
            }

            return(this.state);
        }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
        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;
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public void ChangeState(ActionClick.State state)
 {
     this.state = state;
 }