Exemplo n.º 1
0
 public void Buy(GrowButtons.GrowButton grButton)
 {
     this.waitedButton = grButton;
     if (this.waitedButton != null)
     {
         this.waitedButton.WaitForGrow();
     }
 }
Exemplo n.º 2
0
 public GrowButton(GrowButton grButton)
     : base(grButton)
 {
     this.Manager = grButton.Manager;
     this.Price = grButton.Price;
     this.CoolDown = new Counter.Timer(grButton.CoolDown);
     this.visualCoolDown = new Counter.Timer(grButton.visualCoolDown);
     this.coolDownImage = new Sprite(grButton.coolDownImage);
     this.visualCoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnVisualCoolDownTick);
     this.CoolDown.OnMeet += new Counter.EventOnCounterMeet(this.OnCoolDownTick);
     this.LastCanBuy = grButton.LastCanBuy;
 }
Exemplo n.º 3
0
        public void Grow(Vector2 position)
        {
            if (this.waitedButton == null)
                return;

            this.waitedButton.StopWait();
            GrowButtons.GrowButton grButton = this.waitedButton;
            this.waitedButton = null;

            Griding.Cell cell = this.Manager.GetGriding.IndexOf(position);
            if (cell != null)
            {
                foreach (Griding.IGridable grc in cell.Components)
                {
                    if (grc is Plant.Plant)
                        return;
                }

                Plant.Plant plant = grButton.Buy();
                if (plant != null)
                {
                    plant.Position = position;
                }
            }
        }