本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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]);
}
示例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);
}
示例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)));
}
示例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);
}
示例9: Length
public void Length(ScriptThread thread)
{
thread.SetReturnValue(thread.GetStringParameter(0).Length);
}
示例10: Asc
public void Asc(ScriptThread thread)
{
thread.SetReturnValue((int)thread.GetStringParameter(0)[0]);
}
示例11: WordWrap
public void WordWrap(ScriptThread thread)
{
thread.SetReturnValue(StringMethods.WordWrap(thread.GetStringParameter(0), thread.GetIntegerParameter(1)));
}
示例12: TrimStart
public void TrimStart(ScriptThread thread)
{
thread.SetReturnValue(thread.GetStringParameter(0).TrimStart());
}
示例13: BindedKeyReleased
public void BindedKeyReleased(ScriptThread thread)
{
thread.SetReturnValue(InputManager.BindedKeyReleased(thread.GetStringParameter(0)));
}
示例14: LoadLanguagePack
public void LoadLanguagePack(ScriptThread thread)
{
LanguageManager.LoadLanguagePack(thread.GetStringParameter(0), thread.GetStringParameter(1));
}
示例15: Contains
public void Contains(ScriptThread thread)
{
thread.SetReturnValue(thread.GetStringParameter(0).Contains(thread.GetStringParameter(1)));
}