Beispiel #1
0
        private void readClassDefinition(int classId)
        {
            string className   = reader.ReadUtf8();
            string packageName = reader.ReadUtf8();
            GameDataClassDefinition classDefinition = new GameDataClassDefinition(packageName, className);
            int  fieldsCount = reader.ReadInt();
            uint i           = 0;

            while (i < fieldsCount)
            {
                classDefinition.AddField(reader);
                i++;
            }
            classDefinitions.Add(classId, classDefinition);
        }
Beispiel #2
0
        private void readClassDefinition(int classId)
        {
            string className   = reader.ReadUtf8();
            string packageName = reader.ReadUtf8();
            GameDataClassDefinition classDefinition = new GameDataClassDefinition(packageName, className);

            Console.WriteLine("ClassId: {0} ClassMemberName: {1} ClassPkgName {2}", classId, className, packageName);
            int  fieldsCount = reader.ReadInt();
            uint i           = 0;

            while (i < fieldsCount)
            {
                classDefinition.AddField(reader);
                i++;
            }
            classDefinitions.Add(classId, classDefinition);
        }
Beispiel #3
0
        private string getFieldsBuilder(GameDataClassDefinition classDefinition)
        {
            StringBuilder fieldsBuilder  = new StringBuilder();
            int           numberOfFields = classDefinition.Fields.Count;

            fieldsBuilder.AppendLine("{");
            for (int i = 0; i < numberOfFields; i++)
            {
                fieldsBuilder
                .Append(getFieldBuilder(classDefinition.Fields[i]))
                .Append(writeCommaIfHasMore(numberOfFields, i))
                .AppendLine();
            }
            fieldsBuilder.Append("}");

            return(fieldsBuilder.ToString());
        }
Beispiel #4
0
        private string getObjectBuilder(int classId)
        {
            GameDataClassDefinition classDefinition = classDefinitions[classId];

            return(getFieldsBuilder(classDefinition));
        }