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


C# INakoFuncCallInfo.StackPopAsInt方法代码示例

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


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

示例1: _right

 /// <summary>
 /// 右から部分文字列を返す
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _right(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     int len = (int)info.StackPopAsInt();
     return s.Substring(s.Length-len);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs

示例2: _zeroFill

 /// <summary>
 /// ゼロ埋め
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _zeroFill(INakoFuncCallInfo info)
 {
     long s = info.StackPopAsInt();
     string l = info.StackPopAsInt().ToString();
     return String.Format(@"{0:D"+l+"}",s);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs

示例3: _remove

 private object _remove(INakoFuncCallInfo info)
 {
     object sr = info.StackPop();
     int a = NadesikoPositionToCSPosition((int)info.StackPopAsInt());
     int b = (int)info.StackPopAsInt();
     object s = ((NakoVariable)sr).Body;
     object ret;
     if(s is string){
         ret = ((string)s).Remove(a,b);
     }else{
         ret = null;
     }
     ((NakoVariable)sr).SetBodyAutoType(ret);
     return null;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:15,代码来源:NakoPluginString.cs

示例4: _removeright

 private object _removeright(INakoFuncCallInfo info)
 {
     object sr = info.StackPop();
     int a = (int)info.StackPopAsInt();
     object s = ((NakoVariable)sr).Body;
     object ret;
     if(s is string){
         string _tmp = (string)s;
         ret = _tmp.Remove(_tmp.Length - a);
     }else{
         ret = null;
     }
     ((NakoVariable)sr).SetBodyAutoType(ret);
     return null;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:15,代码来源:NakoPluginString.cs

示例5: _insert

 private object _insert(INakoFuncCallInfo info)
 {
     StringBuilder s = new StringBuilder(info.StackPopAsString());
     int cnt = NadesikoPositionToCSPosition((int)info.StackPopAsInt());
     string a = info.StackPopAsString();
     return s.Insert(cnt,a).ToString();
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:7,代码来源:NakoPluginString.cs

示例6: _left

 /// <summary>
 /// 左からN文字の部分文字列
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _left(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     int len = (int)info.StackPopAsInt();
     return s.Substring(0,len);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs

示例7: _search

 private object _search(INakoFuncCallInfo info)
 {
     object ar = info.StackPop();
     int i = (int)info.StackPopAsInt();
     object key = info.StackPop();
     if (!(ar is NakoVarArray))
     {
         throw new NakoPluginRuntimeException("『検索』の引数が配列ではありません");
     }
     NakoVarArray arr = (NakoVarArray)ar;
     while(arr.GetValue(i)!=null){
        object var = arr.GetValue(i);
        if(var.ToString()==key.ToString()){
            return i;
        }
        i++;
     }
     return -1;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:19,代码来源:NakoPluginArray.cs

示例8: _extract

 /// <summary>
 /// 文字抜き出す
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _extract(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     int a = NadesikoPositionToCSPosition((int)info.StackPopAsInt());
     int cnt = (int)info.StackPopAsInt();
     return s.Substring(a,cnt);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:12,代码来源:NakoPluginString.cs

示例9: _insertArray

 private object _insertArray(INakoFuncCallInfo info)
 {
     object obj_base = info.StackPop(); // 参照渡しなので変数への参照が得られる
     int i   = (int)info.StackPopAsInt();
     object obj_insert = info.StackPop();
     if (!(obj_base is NakoVariable))
     {
         throw new NakoPluginRuntimeException("『配列一括挿入』の元配列がvariableではありません");
     }
     NakoVarArray array_insert = new NakoVarArray();
     if (obj_insert is NakoVariable)
     {
         NakoVariable var_insert = (NakoVariable)obj_insert;
         if(var_insert.Body is NakoVarArray){
             array_insert = (NakoVarArray)var_insert.Body;
         }
     }else if(obj_insert is string){
         array_insert.SetValuesFromString((string)obj_insert);
     }else{
         throw new NakoPluginRuntimeException("『配列一括挿入』の挿入配列がvariableではありません");
     }
     NakoVariable var_base = (NakoVariable)obj_base;
     if(var_base.Body is NakoVarArray){
         NakoVarArray array_base = (NakoVarArray)var_base.Body;
         while(array_insert.Count>0){
             NakoVariable variable = array_insert.Pop();
             array_base.Insert(i,variable);
         }
     }
     return null;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:31,代码来源:NakoPluginArray.cs

示例10: _removeAt

        private object _removeAt(INakoFuncCallInfo info)
        {
            object a = info.StackPop();
            long   i = info.StackPopAsInt();
            if (!(a is NakoVariable))
            {
                throw new NakoPluginRuntimeException("『削除』の引数が変数ではありません");
            }

            NakoVariable av = (NakoVariable)a;
            NakoVarArray a_body = null;
            // 配列でなければ配列に強制変換する
            if (!(av.Body is NakoVarArray))
            {
                a_body = info.CreateArray();
                a_body.SetValuesFromString(av.Body.ToString());
                av.SetBody(a_body, NakoVarType.Array);
            }
            else
            {
                a_body = (NakoVarArray)av.Body;
            }
            // 要素を削除する
            a_body.RemoveAt((int)i);

            // 結果をセット
            return null;
        }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:28,代码来源:NakoPluginArray.cs

示例11: _cin

 /// <summary>
 /// 標準入力取得
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public object _cin(INakoFuncCallInfo info)
 {
     long count = info.StackPopAsInt();
     //TODO:標準入力の取得方法が効率が悪い
     long i = 0;
     string r = "";
     while (i < count)
     {
         int ch = System.Console.Read();
         if (ch < 0) break;
         r += (char)ch;
         i++;
     }
     return r;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:20,代码来源:NakoPluginConsole.cs

示例12: _to_int

 public object _to_int(INakoFuncCallInfo info)
 {
     return info.StackPopAsInt();
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:4,代码来源:NakoPluginCast.cs

示例13: _unixtime_to_datetime

 public object _unixtime_to_datetime(INakoFuncCallInfo info)
 {
     long unixtime = info.StackPopAsInt();
     return UnixEpoch.AddSeconds(unixtime).ToLocalTime();
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:5,代码来源:NakoPluginDateTime.cs

示例14: _random

 private object _random(INakoFuncCallInfo info)
 {
     long range = info.StackPopAsInt();
     if (_randObj == null) {
         _randObj = new Random();
     }
     int v = _randObj.Next((int)range);
     return (long)v;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:9,代码来源:NakoBaseSystem.cs

示例15: _intVal

 private object _intVal(INakoFuncCallInfo info)
 {
     return info.StackPopAsInt();
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:4,代码来源:NakoBaseSystem.cs


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