static int _m_GetRange(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                System.Collections.Generic.List <int> __cl_gen_to_be_invoked = (System.Collections.Generic.List <int>)translator.FastGetCSObj(L, 1);



                {
                    int index = LuaAPI.xlua_tointeger(L, 2);
                    int count = LuaAPI.xlua_tointeger(L, 3);

                    System.Collections.Generic.List <int> __cl_gen_ret = __cl_gen_to_be_invoked.GetRange(index, count);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #2
0
        /// <summary>
        /// Delete number of last elements from queue and return them.
        /// </summary>
        /// <param name="count">Number of elements</param>
        /// <returns>Array of elements</returns>
        public T[] Chop(int count)
        {
            bool signal = false;

            try
            {
                lock (_List)
                {
                    if (count > _List.Count)
                    {
                        count = _List.Count;
                    }
                    if (count == 0)
                    {
                        return new T[] { }
                    }
                    ;
                    signal = true;
                    int      first = _List.Count - count;
                    List <T> list  = _List.GetRange(first, count);
                    _List.RemoveRange(first, count);
                    return(list.ToArray());
                }
            }
            finally
            {
                if (signal)
                {
                    if (OnChop != null)
                    {
                        OnChop(this);
                    }
                }
            }
        }
Пример #3
0
 private void makeFirst(System.Collections.Generic.List <Vector3> list, int index)
 {
     if (index != 0)
     {
         System.Collections.Generic.List <Vector3> range = list.GetRange(index, list.Count - index);
         list.RemoveRange(index, list.Count - index);
         list.InsertRange(0, range);
     }
 }
Пример #4
0
 static public int GetRange(IntPtr l)
 {
     try {
         System.Collections.Generic.List <WWWRequest> self = (System.Collections.Generic.List <WWWRequest>)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         var ret = self.GetRange(a1, a2);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #5
0
 public IList ReisenGetRange(int index, int count)
 {
     return(dieReisen.GetRange(index, count));
 }
        public static List <MessageBoardMessage> GetList(uint Channel, uint Index)
        {
            List <MessageBoardMessage> Board = new System.Collections.Generic.List <MessageBoardMessage>();

            switch (Channel)
            {
            //Trade
            case 2201:
                Board = Trade;
                break;

            //Friends
            case 2202:
                Board = Friends;
                break;

            //Team
            case 2203:
                Board = Team;
                break;

            //Guild
            case 2204:
                Board = Guild;
                break;

            //Other
            case 2205:
                Board = Other;
                break;
            }

            ///Rather complicated. Checks the board to see if there is enough listings to display a new page.
            ///TQ sends the page # in increments of 8. Example: 0 = 1st Page, 8 = 2nd Page, 16 = 3rd Page etc etc
            ///So this checks to see if there is enough to send a full page (12 listings)
            ///If there isnt, it checks to see if there is enough to send a partial page.
            ///If there isnt, it sends a blank page.

            if (Board != null && Board.Count > 0)
            {
                switch (Index)
                {
                case 0:
                    if (Board.Count >= 12)
                    {
                        return(Board.GetRange(0, 12));
                    }
                    else
                    {
                        return(Board.GetRange(0, Board.Count));
                    }

                default:
                    if (Board.Count > (Index / 8) * 12)
                    {
                        if (Board.Count >= ((Index / 8) * 12) + 12)
                        {
                            return(Board.GetRange((int)(((Index / 8) * 12)), 12));
                        }
                        else
                        {
                            return(Board.GetRange((int)(((Index / 8) * 12)), Board.Count - (int)((Index / 8) * 12)));
                        }
                    }
                    else
                    {
                        return(new System.Collections.Generic.List <MessageBoardMessage>());
                    }
                }
            }
            else
            {
                return(new System.Collections.Generic.List <MessageBoardMessage>());
            }
        }