05
09/17
if else过多应该使用策略模式
public class Test { private int type; Dictionary<int, Action> actionList = new Dictionary<int, Action>(); public Test(int _type) { type = _type; actionList.Add(1, () => { /*todo 1 */ }); actionList.Add(2, () => { /*todo 2 */}); actionList.Add(3, () => { /*todo 3 */}); actionList.Add(4, () => { /*todo 4 */}); } public void Do(...