Exemplo n.º 1
0
        /// <summary>
        /// Tokenize stream
        /// </summary>
        /// <param name="input">Text stream</param>
        /// <param name="filePath">File path used to tokens location only</param>
        /// <returns></returns>
        /// <usage>
        ///     Tokenizer tokenizer = new Tokenizer(new TextReader(), "FILE PATH");
        ///     List<Token> tokenList = new List<Token>();
        ///     Token token;
        ///     while (GetNextToken(ref token))
        ///         tokenList.Add(token);
        /// </usage>
        public Tokenizer(TextReader input, string filePath)
        {
            builder   = new BetterStringBuilder(1024);
            reader    = new TokenReader(input, filePath);
            Character = -1;
            builder.Clear();

            // Get next character
            NextChar();
        }
    // Use this for initialization
    void Start()
    {
        mBsb          = new BetterStringBuilder(30, 0, BetterStringBuilderBufferType.None);
        mTestClass1   = new CustomClass();
        mTestClass1.a = 2;
        mTestClass2   = new CustomClass();
        mTestClass2.a = 1;

        mSortInt    = TestSort;
        mSortString = TestSort;
        mSortStruct = TestSort;
        mSortClass  = TestSort;
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     mBetterLinkedList1 = new BetterLinkedList <int>();
     mBetterLinkedList2 = new BetterLinkedList <string>();
     mBetterLinkedList3 = new BetterLinkedList <CustomStruct>();
     mBetterLinkedList4 = new BetterLinkedList <CustomClass>();
     mBsb = new BetterStringBuilder(30, 0, BetterStringBuilderBufferType.None);
     for (int i = 0; i < 100; i++)
     {
         mTestString.Add("test" + i.ToString());
         mTestCustomStruct.Add(new CustomStruct(i, mTestString[i]));
         mTestCustomClass.Add(new CustomClass(i, mTestString[i], mTestCustomStruct[i]));
     }
 }
Exemplo n.º 4
0
        private void ShowTextEffect(int number)
        {
            // TODO [bgish]: Fire off a Network Message so the other clients can fire the effect too

            // Setting the text
            if (this.effectText != null)
            {
                BetterStringBuilder.New()
                .Append(Math.Abs(number))
                .Append(" ")
                .Append(number < 0 ? "Left" : "Right")
                .Set(this.effectText);
            }

            // Playing the animator
            if (this.effectAnimator != null)
            {
                this.effectAnimator.enabled = true;
            }
        }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     bsb = new BetterStringBuilder(512, 1024);
 }