当前位置: 首页>>代码示例>>C#>>正文


C# ScriptThread.GetStringParameter方法代码示例

本文整理汇总了C#中BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread.GetStringParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptThread.GetStringParameter方法的具体用法?C# ScriptThread.GetStringParameter怎么用?C# ScriptThread.GetStringParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread的用法示例。


在下文中一共展示了ScriptThread.GetStringParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CharacterCount

 public void CharacterCount(ScriptThread thread)
 {
     string haystack = thread.GetStringParameter(0);
     string needle = thread.GetStringParameter(1);
     int count = 0;
     for (int i = 0; i < haystack.Length; i++)
         if (haystack[i] == needle[0]) count++;
     thread.SetReturnValue(count);
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:9,代码来源:String.cs

示例2: ExecuteFile

 public void ExecuteFile(ScriptThread thread)
 {
     Process process = new Process();
     process.StartInfo.FileName = thread.GetStringParameter(0);
     process.StartInfo.Arguments = thread.GetStringParameter(1);
     process.StartInfo.Verb = "Open";
     process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
     process.Start();
     if (thread.GetBooleanParameter(2) == true) process.WaitForExit();
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:10,代码来源:Runtime.cs

示例3: Explode

        public void Explode(ScriptThread thread)
        {
            string explodee = thread.GetStringParameter(0);
            char seperator = thread.GetStringParameter(1)[0];
            string[] exploded = explodee.Split(new char[] { seperator });

            int arrayMemoryIndex = thread.AllocateArray(DataType.String, exploded.Length);
            for (int i = 0; i < exploded.Length; i++)
                thread.SetArrayElement(arrayMemoryIndex, i, exploded[i]);

            thread.SetReturnValueArray(arrayMemoryIndex);
        }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:12,代码来源:String.cs

示例4: CommandLineValue

        public void CommandLineValue(ScriptThread thread)
        {
            string commandLine = thread.GetStringParameter(0);
            int valueIndex = thread.GetIntegerParameter(1);

            foreach (string arg in Engine.GlobalInstance.CommandLineArguments)
            {
                string[] value = new string[0];
                string command = arg;
                int colonIndex = arg.IndexOf(':');

                // Seperate values and command if a colon exists.
                if (colonIndex >= 0)
                {
                    value = new string[1];
                    value[0] = arg.Substring(colonIndex + 1, arg.Length - colonIndex - 1);
                    if (value[0].IndexOf(",") >= 0) value = value[0].Split(new char[1] { ',' });
                    command = arg.Substring(0, colonIndex);
                }

                if (command.ToLower() == commandLine.ToLower())
                {
                    if (valueIndex < 0 || valueIndex >= value.Length)
                    {
                        DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CommandLineValue with an invalid value index.", LogAlertLevel.Error);
                        return;
                    }
                    thread.SetReturnValue(value[valueIndex]);
                    return;
                }
            }

            DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CommandLineValue with a non-existant command line.", LogAlertLevel.Error);
        }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:34,代码来源:Engine.cs

示例5: GameFlag

 public void GameFlag(ScriptThread thread)
 {
     string key = thread.GetStringParameter(0).ToLower();
     if (!Fusion.GlobalInstance.GameFlags.Contains(key))
         return;
     thread.SetReturnValue((string)Fusion.GlobalInstance.GameFlags[key]);
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:7,代码来源:Fusion.cs

示例6: CommandLineExists

        public void CommandLineExists(ScriptThread thread)
        {
            string commandLine = thread.GetStringParameter(0);

            foreach (string arg in Engine.GlobalInstance.CommandLineArguments)
            {
                string[] value = new string[0];
                string command = arg;
                int colonIndex = arg.IndexOf(':');

                // Seperate values and command if a colon exists.
                if (colonIndex >= 0)
                {
                    value = new string[1];
                    value[0] = arg.Substring(colonIndex + 1, arg.Length - colonIndex - 1);
                    if (value[0].IndexOf(",") >= 0) value = value[0].Split(new char[1] { ',' });
                    command = arg.Substring(0, colonIndex);
                }

                if (command.ToLower() == commandLine.ToLower())
                {
                    thread.SetReturnValue(true);
                    return;
                }
            }

            thread.SetReturnValue(false);
        }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:28,代码来源:Engine.cs

示例7: OpenStream

 public void OpenStream(ScriptThread thread)
 {
     Stream stream = StreamFactory.RequestStream(thread.GetStringParameter(0), (StreamMode)thread.GetIntegerParameter(1));
     if (stream == null)
     {
         DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called OpenStream with an unreachable url.", LogAlertLevel.Error);
         return;
     }
     thread.SetReturnValue(new StreamScriptObject(new ScriptStream(stream)));
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:10,代码来源:IO.cs

示例8: InvokeThreadFunction

 public void InvokeThreadFunction(ScriptThread thread)
 {
     ScriptThread actionThread = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptThread;
     if (actionThread == null)
     {
         DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called InvokeThreadFunction with an invalid object.", LogAlertLevel.Error);
         return;
     }
     actionThread.InvokeFunction(thread.GetStringParameter(1), thread.GetBooleanParameter(2), thread.GetBooleanParameter(3), false);
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:10,代码来源:Thread.cs

示例9: Length

 public void Length(ScriptThread thread)
 {
     thread.SetReturnValue(thread.GetStringParameter(0).Length);
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:String.cs

示例10: Asc

 public void Asc(ScriptThread thread)
 {
     thread.SetReturnValue((int)thread.GetStringParameter(0)[0]);
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:String.cs

示例11: WordWrap

 public void WordWrap(ScriptThread thread)
 {
     thread.SetReturnValue(StringMethods.WordWrap(thread.GetStringParameter(0), thread.GetIntegerParameter(1)));
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:String.cs

示例12: TrimStart

 public void TrimStart(ScriptThread thread)
 {
     thread.SetReturnValue(thread.GetStringParameter(0).TrimStart());
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:String.cs

示例13: BindedKeyReleased

 public void BindedKeyReleased(ScriptThread thread)
 {
     thread.SetReturnValue(InputManager.BindedKeyReleased(thread.GetStringParameter(0)));
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:Input.cs

示例14: LoadLanguagePack

 public void LoadLanguagePack(ScriptThread thread)
 {
     LanguageManager.LoadLanguagePack(thread.GetStringParameter(0), thread.GetStringParameter(1));
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:Language.cs

示例15: Contains

 public void Contains(ScriptThread thread)
 {
     thread.SetReturnValue(thread.GetStringParameter(0).Contains(thread.GetStringParameter(1)));
 }
开发者ID:HampsterEater,项目名称:FusionGameEngine,代码行数:4,代码来源:String.cs


注:本文中的BinaryPhoenix.Fusion.Runtime.Scripting.ScriptThread.GetStringParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。