Example #1
0
 public ScriptValue.Int CreateScriptValue(int value)
 {
     if (IntValues.ContainsKey(value))
     {
         return(IntValues[value]);
     }
     return(IntValues[value] = new ScriptValue.Int(value));
 }
Example #2
0
 public ScriptValue.Int GetInteger(uint offset)
 {
     if (IntElements.ContainsKey(offset))
     {
         return(IntElements[offset]);
     }
     return(IntElements[offset] = new ScriptValue.Int(Reader.Seek(offset).ReadInt32()));
 }
Example #3
0
 public ScriptValue.Int CreateScriptValuePointer(int id)
 {
     if (PtrValues.ContainsKey(id))
     {
         return(PtrValues[id]);
     }
     return(PtrValues[id] = new ScriptValue.Int(0)
     {
         PointerId = id
     });
 }
Example #4
0
        public uint Write(ScriptValue.Int value)
        {
            if (Offsets.ContainsKey(value))
            {
                return(Offsets[value]);
            }
            uint offset = (uint)Stream.Position;

            Writer.Write(value.IntValue);
            return(Offsets[value] = offset);
        }
Example #5
0
        public uint Write(int value)
        {
            var scriptValue = new ScriptValue.Int(value);

            if (Offsets.ContainsKey(scriptValue))
            {
                return(Offsets[scriptValue]);
            }
            uint offset = (uint)Stream.Position;

            Writer.Write(value);
            return(Offsets[scriptValue] = offset);
        }