Exemplo n.º 1
0
 public static void Enqueue(Pattern.Pattern p)
 {
     patternQueue.Enqueue(p);
     if (BoardRegister.allReady())
     {
         QueueProcessor.Notify();
     }
 }
Exemplo n.º 2
0
        public static Pattern Parse(string pString)
        {
            Pattern p = new Pattern();
            string[] pSplit = pString.Split(new char[] { ',' });
            int len = int.Parse(pSplit[0]);
            p.SetTime((byte)int.Parse(pSplit[1]));
            int j = 2;

            for (int count = 0; count < len; count++)
            {
                int color = 0;

                color |= (byte)int.Parse(pSplit[j]);
                color <<= 8;
                j++;

                color |= (byte)int.Parse(pSplit[j]);
                color <<= 8;
                j++;

                color |= (byte)int.Parse(pSplit[j]);
                j++;

                byte x = (byte)int.Parse(pSplit[j]);
                j++;

                byte y = (byte)int.Parse(pSplit[j]);
                j++;

                short tdelay = short.Parse(pSplit[j]);
                j++;

                p.Add(new PatternNode() { color = color, time_delay = tdelay, x = x, y = y });
            }

            return p;
        }