private void CreateCommands() { commands = new Command[9]; commands[0] = new Command(() => StartMovingBlockLeft()); commands[1] = new Command(() => { Controller.isBlockMovingLeft = false; }); commands[2] = new Command(() => StartMovingBlockRight()); commands[3] = new Command(() => { Controller.isBlockMovingRight = false; }); commands[4] = new Command(() => Controller.RotateBlockAntiClockwiseIfPossible()); commands[5] = new Command(() => { Controller.IsFallingFast = true; }); commands[6] = new Command(() => { Controller.IsFallingFast = false; }); commands[7] = new Command(position => { Pressing(position); }); commands[8] = new Command(() => { Controller.IsFallingFast = false; }); }
private void Pressing(Vector2D position) { if (position.X < 0.4f) { Controller.MoveBlockLeftIfPossible(); //ncrunch: no coverage } else if (position.X > 0.6f) { Controller.MoveBlockRightIfPossible(); //ncrunch: no coverage } else if (position.Y < 0.5f) { Controller.RotateBlockAntiClockwiseIfPossible(); //ncrunch: no coverage } else { Controller.IsFallingFast = true; } }