Exemplo n.º 1
0
        public void read(Reader reader, List <string> objectNames = null, List <string> variableNames = null)
        {
            name = new NameIdentifier(reader);

            byte variableCount = reader.ReadByte();

            for (int v = 1; v < variableCount; ++v)
            {
                variables.Add(new VariableInfo(reader, variableNames));
            }

            ushort entityCount = reader.ReadUInt16();

            for (int e = 0; e < entityCount; ++e)
            {
                entities.Add(new SceneEntity(reader, this));
            }

            // if we have possible names, search em
            if (objectNames != null)
            {
                string hashString = name.hashString();
                foreach (string varName in objectNames)
                {
                    NameIdentifier currentName       = new NameIdentifier(varName);
                    string         currentHashedName = currentName.hashString();
                    if (currentHashedName == hashString)
                    {
                        name = currentName;
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void read(Reader reader, List <string> variableNames = null)
        {
            name = new NameIdentifier(reader);
            type = (VariableTypes)reader.ReadByte();

            // if we have possible names, search em
            if (variableNames != null)
            {
                string hashString = name.hashString();
                foreach (string varName in variableNames)
                {
                    NameIdentifier currentName       = new NameIdentifier(varName);
                    String         currentHashedName = currentName.hashString();
                    if (currentHashedName == hashString)
                    {
                        name = currentName;
                        break;
                    }
                }
            }
        }