我正在阅读 Pulling the switch here并遇到了这段代码。
somoone 可以解释一下什么是() => {}
什么,我应该阅读什么来理解那行代码?
var moveMap = new Dictionary<string, Action>()
{
{"Up", MoveUp},
{"Down", MoveDown},
{"Left", MoveLeft},
{"Right", MoveRight},
{"Combo", () => { MoveUp(); MoveUp(); MoveDown(); MoveDown(); }}
};
moveMap[move]();