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)); }
public void Interact(Ball ball) { if (Color.Equals(ball.Color)) { _actions.Add(new StepAction(ActionType.BascketColorMatched, null, GetPosition())); Score++; } else { Score--; _actions.Add(new StepAction(ActionType.BascketColorMissing, null, GetPosition())); } ball.GetActions().Add(new Ball.StepAction(ActionType.BallConsumed, this, GetPosition(), ball.Color)); }