logo

Crowdly

Browser

Add to Chrome

public class MoveCommand : ICommand { private readonly Actor _a; private re...

✅ 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?

0%
0%
100%
0%
More questions like this

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome