Exemple #1
0
        internal static object Call(string call_type, params object[] args)
        {
            switch (call_type)
            {
            case "GetModSettings":
                return(OnARailAPI.GetModSettings());

            case "SaveModSettingsChanges":
                OnARailAPI.SaveModSettingsChanges();
                return(null);
            }

            throw new Exception("No such api call " + call_type);
        }
Exemple #2
0
        ////////////////

        public override object Call(params object[] args)
        {
            if (args.Length == 0)
            {
                throw new Exception("Undefined call type.");
            }

            string call_type = args[0] as string;

            if (args == null)
            {
                throw new Exception("Invalid call type.");
            }

            var new_args = new object[args.Length - 1];

            Array.Copy(args, 1, new_args, 0, args.Length - 1);

            return(OnARailAPI.Call(call_type, new_args));
        }