public void Save(BinaryWriter W) { W.Write(List.Count); for (int i = 0; i < List.Count; i++) { LType T = List[i].Item1; W.WriteLuaType(T); switch (T) { case LType.Nil: break; case LType.Bool: W.Write((bool)List[i].Item2); break; case LType.Number: W.Write((double)List[i].Item2); break; case LType.String: W.WriteLuaString((string)List[i].Item2); break; default: throw new Exception("Type " + T.ToString() + " not implemented"); } } W.Write(Functions.Count); foreach (Function Func in Functions) { Func.Save(W); } }
public static void Write(LType type, string txt) { OnWrite?.Invoke(type, txt); if (type == LType.HttpInfo) { OutputStream?.WriteS("[{2}][{0}] {1}", type.ToString(), txt, DateTime.Now.ToLongTimeString()); } }