private void AddBuiltin(string var_name, float value) { var __value = new GMValue { ValType = GMValue.GMValueType.Real, Number = value, Name = var_name }; BuiltinVariables.Add(__value); }
private void AddBuiltin(string var_name, bool value) { var __value = new GMValue { ValType = GMValue.GMValueType.Bool, Number = value ? 1 : 0, Name = var_name }; BuiltinVariables.Add(__value); }
public void ReadGlobals(BinaryReader reader) { Globals.Clear(); uint len = reader.ReadUInt32(); if (len != 0) { for (int i = 0; i < len; i++) { GMValue val = ReadGMValueFromBuffer(reader); Globals.Add(val); Console.WriteLine(val); } } }
public GMValue ReadGMValueFromBuffer(BinaryReader reader) { int var_id = reader.ReadInt32(); string name = "<unknown>"; if (RunnerLayout.Variables.ContainsKey(var_id)) { name = RunnerLayout.Variables[var_id]; } else { Debug.Assert(false); } var ___ret = new GMValue(); ___ret.ReadFromBuffer(reader); ___ret.Name = name; return(___ret); }