public void Init(BallSettings ballSettings, ITrajectoryDataSource trajectorySource, int ballIndex) { BallIndex = ballIndex; m_BallSettings = ballSettings; m_TrajectorySource = trajectorySource; MovingSpeed = m_BallSettings.MaxBallSpeed; m_BallInputHandler = new BallInputHandler(m_BallSettings.DoubleClickSensitivity); m_BallStateManager = new BallActionManager(this, m_TrajectorySource, m_BallInputHandler, m_BallSettings); }
public BallActionManager(BallFacade ball, ITrajectoryDataSource trajectorySource, BallInputHandler ballInputHandler, BallSettings ballSettings) { m_Actions = new Dictionary <BallActions, IBallAction>(); m_Actions.Add(BallActions.Idle, new IdleAction()); m_Actions.Add(BallActions.Moving, new MoveDrawTrajectoryAction(ball, trajectorySource, ballSettings)); m_Actions.Add(BallActions.MoveToTrajectoryStart, new MoveToTrajectoryStart(ball, trajectorySource)); SetAction(BallActions.MoveToTrajectoryStart); m_BallInputHandler = ballInputHandler; m_BallInputHandler.SingleMouseClick += ProcessSingleMouseClick; m_BallInputHandler.DoubleMouseClick += ProcessDoubleMouseClick; }