예제 #1
0
        /// <summary>
        /// Update whole column
        /// </summary>
        /// <param name="speed"></param>
        public void Update(object speed)
        {
            while (true)
            {
                Thread.Sleep((int)speed);
                foreach (var chain in Chains)
                {
                    chain.CurrentLocationHead++;
                }
                if (CheckToAdd())
                {
                    AddChain(new Chain());
                }

                var firstChain = Chains.Peek();
                if (CheckToRemove(firstChain))
                {
                    RemoveChain(firstChain);
                }

                isUpdated = true;
            }
        }