public void Interact(Ball ball) { if (!ball.Color.Equals(MatchColor)) { _actions.Add(new StepAction(ActionType.ConditionFalse, null, GetPosition())); // Движение в другую сторону. var newPoint = new Point(MoveVector.X * -1, MoveVector.Y); ball.Move(newPoint); return; } _actions.Add(new StepAction(ActionType.ConditionTrue, null, GetPosition())); ball.Move(MoveVector); }
public void Interact(Ball ball) { _actions.Add(new StepAction(ActionType.BallInteract, null, GetPosition())); var newPoint = new Point(_position.X - 1, _position.Y); ball.Move(newPoint); }
public void Interact(Ball ball) { if (false && !ball.Color.Equals(FromColor)) { _actions.Add(new StepAction(ActionType.SwitcherNope, null, GetPosition())); return; } ball.Color = ToColor; ball.GetActions().Add(new Ball.StepAction(ActionType.BallChangeColor, this, ball.GetPosition(), ball.Color)); ball.Move(0, 1); ball.GetActions().Add(new Ball.StepAction(ActionType.BallMove, this, ball.GetPosition(), ball.Color)); }