/// <summary> /// Given a stream, the function will deserialize it into a /// specific type. /// </summary> /// <typeparam name="T">The type to deserialize</typeparam> /// <param name="data">The stream to extract the object</param> /// <returns>The object deserialized from the stream</returns> public static T Deserialize <T>(Stream data) { if (data == null) { throw new ArgumentNullException("data"); } using (var reader = new StreamReader(data, Globals.ParadoxEncoding, false, MaxByteBuffer)) { FnPtr ptr = Deserializer.Parse(typeof(T)); ParadoxParser parser = new ParadoxParser(reader); return((T)ptr(parser)); } }
public BuiltInFunction(string name, int argCount, FnPtr fnPtr) { m_name = name; m_argCount = argCount; m_function = fnPtr; }