:orphan: .. **************************************************************************** .. CUI .. .. The Advanced Framework for Simulation, Integration, and Modeling (AFSIM) .. .. The use, dissemination or disclosure of data in this file is subject to .. limitation or restriction. See accompanying README and LICENSE for details. .. **************************************************************************** Method ------ .. class:: Method :cloneable: :class:`Method` contains a callable script method. See also :class:`Signal` Static Methods ============== .. method:: static Method Create(string aMethodName) Returns a new Method pointing to the global function named aMethodName. Method m = Method.Create("my_func"); .. method:: static Method Create(Object aObject, string aMethodName) Returns a new Method pointing to aObject's method named aMethodName. Method m = Method.Create(PLATFORM, "my_func"); Methods ======= .. method:: Object Call() Executes a method that takes no parameters. Returns the return value of the method. .. method:: Object Call(Array aParameters) Executes a method that takes parameters. aParameters is an array containing the parameters to be passed to the method. Returns the return value of the method. .. method:: Object Base() Returns the object that owns the method. Null for global methods. .. method:: string Name() Returns the name of the method. .. method:: Method Bind(int aParameterIndex, Object aValue) Returns a new method with one of the method's parameters bound to a value. The new method takes one less parameter. This can be useful when adding callbacks to waypoints. Example:: script print_data(string s) writeln(s); end_script ... script use_method() Method m = Method.Create("print_data"); Method bm = m.Bind(0, "Bound Value"); // bm takes no arguments. This will print "Bound Value": bm.Call(); end_script