BBGamelib.flash.imp.Utils.ReadLength C# (CSharp) Method

ReadLength() public static method

public static ReadLength ( byte data, Cursor cursor ) : int
data byte
cursor Cursor
return int
		public static int ReadLength(byte[] data, Cursor cursor)
		{
			return Utils.ReadInt32 (data, cursor);
		}
		public static Vector2 ReadVector2(byte[] data, Cursor cursor)

Usage Example

        void readDefines(byte[] data, Cursor cursor)
        {
            int len      = Utils.ReadLength(data, cursor);
            int newIndex = cursor.index + len;

            int maxcharacterId = Utils.ReadInt32(data, cursor);
            int definesCount   = Utils.ReadInt32(data, cursor);

            chId_defs     = new TagDefine[maxcharacterId + 1];
            classNameDefs = new Dictionary <string, TagDefine> (definesCount / 4);

            for (int i = 0; i < definesCount; i++)
            {
                TagDefine define = parseDefine(this, data, cursor);

                if (define != null)
                {
                    chId_defs[define.characterId] = define;
                    if (define is TagDefine && (define as TagDefine).className != null)
                    {
                        classNameDefs[(define as TagDefine).className] = define;
                    }
                }
            }
            cursor.index = newIndex;
        }
All Usage Examples Of BBGamelib.flash.imp.Utils::ReadLength