Exemplo n.º 1
0
        private ScriptExpressionTable LoadExpressions(IReader reader, StructureValueCollection values,
                                                      StringTableReader stringReader)
        {
            var             count   = (int)values.GetInteger("number of script expressions");
            uint            address = values.GetInteger("script expression table address");
            StructureLayout layout  = _buildInfo.Layouts.GetLayout("script expression entry");

            StructureValueCollection[] entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, _metaArea);

            var result = new ScriptExpressionTable();

            result.AddExpressions(entries.Select((e, i) => new ScriptExpression(e, (ushort)i, stringReader)));

            foreach (ScriptExpression expr in result.Where(expr => expr != null))
            {
                expr.ResolveReferences(result);
            }

            return(result);
        }
Exemplo n.º 2
0
        private ScriptExpressionTable LoadExpressions(IReader reader, StructureValueCollection values,
                                                      StringTableReader stringReader)
        {
            var  stringsSize = (int)values.GetInteger("script string table size");
            var  count       = (int)values.GetInteger("number of script expressions");
            uint address     = (uint)values.GetInteger("script expression table address");
            long expand      = _expander.Expand(address);

            StructureLayout layout = _buildInfo.Layouts.GetLayout("script expression element");

            StructureValueCollection[] entries = TagBlockReader.ReadTagBlock(reader, count, expand, layout, _metaArea);

            var result = new ScriptExpressionTable();

            result.AddExpressions(entries.Select((e, i) => new ScriptExpression(e, (ushort)i, stringReader, stringsSize)));

            foreach (ScriptExpression expr in result.Where(expr => expr != null))
            {
                expr.ResolveReferences(result);
            }

            return(result);
        }
        private ScriptExpressionTable LoadExpressions(IReader reader, StructureValueCollection values,
			StringTableReader stringReader)
        {
            var count = (int) values.GetInteger("number of script expressions");
            uint address = values.GetInteger("script expression table address");
            StructureLayout layout = _buildInfo.Layouts.GetLayout("script expression entry");
            StructureValueCollection[] entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, _metaArea);

            var result = new ScriptExpressionTable();
            result.AddExpressions(entries.Select((e, i) => new ScriptExpression(e, (ushort) i, stringReader)));

            foreach (ScriptExpression expr in result.Where(expr => expr != null))
                expr.ResolveReferences(result);

            return result;
        }