public void setLeftCommand(LeftCommand leftCommand) { this.leftCommand = leftCommand; }
public void setRightCommand(RightCommand rightCommand) { this.rightCommand = rightCommand; }
public void setFallCommand(FallCommand fallCommand) { this.fallCommand = fallCommand; }
public void setTransformCommand(TransformCommand transformCommand) { this.transformCommand = transformCommand; }
public void toLeft(){ leftCommand.execute(); } public void toRight(){ rightCommand.execute(); } public void fall(){ fallCommand.execute(); } public void transform(){ transformCommand.execute(); }
LeftCommand leftCommand = new LeftCommand(terisMachine); RightCommand rightCommand = new RightCommand(terisMachine); FallCommand fallCommand = new FallCommand(terisMachine); TransformCommand transformCommand = new TransformCommand(terisMachine);
Buttons buttons = new Buttons(); buttons.setLeftCommand(leftCommand); buttons.setRightCommand(rightCommand); buttons.setFallCommand(fallCommand); buttons.setTransformCommand(transformCommand);