您好,我在按 int 值排序该字典时遇到了一点问题。
这是字典:
_cleanHelper =
new Dictionary<Direction, Dictionary<CleanTypes, List<List<int>>>>()
{
{
Direction.North, new Dictionary<CleanTypes, List<List<int>>>()
{
{
CleanTypes.Walled, new List<List<int>>()
{
new List<int>()
{
0, -1
},
new List<int>()
{
1, -1
},
new List<int>()
{
1, 0
},
new List<int>()
{
1, 1
},
new List<int>()
{
0, 1
}
}
},
{
CleanTypes.Close, new List<List<int>>()
{
new List<int>()
{
0, 0
}
}
},
{
CleanTypes.Recurse, new List<List<int>>()
{
new List<int>()
{
-1, 0
}
}
}
}
},
{
Direction.South, new Dictionary<CleanTypes, List<List<int>>>()
{
{
CleanTypes.Walled, new List<List<int>>()
{
new List<int>()
{
0, -1
},
new List<int>()
{
-1, -1
},
new List<int>()
{
-1, 0
},
new List<int>()
{
-1, 1
},
new List<int>()
{
0, 1
}
}
},
{
CleanTypes.Close, new List<List<int>>()
{
new List<int>()
{
0, 0
}
}
},
{
CleanTypes.Recurse, new List<List<int>>()
{
new List<int>()
{
1, 0
}
}
}
}
},
{
Direction.West, new Dictionary<CleanTypes, List<List<int>>>()
{
{
CleanTypes.Walled, new List<List<int>>()
{
new List<int>()
{
-1, 0
},
new List<int>()
{
-1, 1
},
new List<int>()
{
0, 1
},
new List<int>()
{
1, 1
},
new List<int>()
{
1, 0
}
}
},
{
CleanTypes.Close, new List<List<int>>()
{
new List<int>()
{
0, 0
}
}
},
{
CleanTypes.Recurse, new List<List<int>>()
{
new List<int>()
{
0, -1
}
}
}
}
},
{
Direction.East, new Dictionary<CleanTypes, List<List<int>>>()
{
{
CleanTypes.Walled, new List<List<int>>()
{
new List<int>()
{
-1, 0
},
new List<int>()
{
-1, -1
},
new List<int>()
{
0, -1
},
new List<int>()
{
1, -1
},
new List<int>()
{
1, 0
}
}
},
{
CleanTypes.Close, new List<List<int>>()
{
new List<int>()
{
0, 0
}
}
},
{
CleanTypes.Recurse, new List<List<int>>()
{
new List<int>()
{
0, 1
}
}
}
}
}
};
在运行时,我制作了几个副本,并且需要有一种方法按整数值升序对它们进行排序。我将如何最好地做到这一点?
谢谢您的帮助!