-1
你好,我有一個問題,整數這個字典的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
}
}
}
}
}
};
在運行時我做的這幾個副本,需要有一種方法由按升序排列整數值對它們進行排序。我最好怎麼做?
謝謝你的幫助!
一個詞典列表的整數列表詞典?聖母瑪利亞。難道你不能用某種'Vector'或'Point'數據類型來清理它嗎? – JosephHirn 2013-02-11 14:20:30
重新設計您的數據結構可能是明智的... – Syjin 2013-02-11 14:22:13