✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
public class MoveCommand : ICommand
{
private readonly Actor _a; private readonly Vector2 _d;
public MoveCommand(Actor a, Vector2 d)=>(_a,_d)=(a,d);
public void Execute() => _a.MoveBy(_d);
public void Undo() => _a.MoveBy(-_d);
}
Чому Undo має доступ до того ж Actor і Vector2?