示例#1
0
    public void Fetch()
    {
        if (left.Count > 0 || right.Count > 0)
        {
            Debug.LogWarning($"{left[0].Name} vs {right[0].Name}");
            return;
        }

        if (current.Count > 1)
        {
            left.AddRange(new List <Entry>(current[0]));
            right.AddRange(new List <Entry>(current[1]));
            Debug.LogWarning($"{left[0].Name} vs {right[0].Name}");
            current.RemoveRange(0, 2);
            return;
        }
        else if (current.Count > 0)
        {
            next.Add(new List <Entry>(current[0]));
            current.RemoveAt(0);
        }

        if (!Cycle())
        {
            Debug.Log($"End: {progress} // Total: {total}");
            return;
        }

        Fetch();
    }
        public void SerializeNestedList()
        {
            var list1 = new SomeList()
            {
                new ListItem("aaa"), new ListItem("bbb")
            };
            var list2 = new SomeList()
            {
                new ListItem("ccc"), new ListItem("ddd")
            };
            var nestedList = new NestedList();

            nestedList.Add(list1);
            nestedList.Add(list2);

            Serializer.Serialize(Stream.Null, nestedList);
        }
示例#3
0
    public bool Cycle()
    {
        current.Clear();
        foreach (List <Entry> item in next)
        {
            current.Add(new List <Entry>(item));
            if (item.Count == size)
            {
                next.Clear();
                return(false);
            }
        }

        next.Clear();
        return(true);
    }