public MoveToTrajectoryStart(BallFacade ball, ITrajectoryDataSource trajectorySource) { m_Ball = ball; m_TrajectorySource = trajectorySource; m_WayPoints = m_TrajectorySource.GetWayPoints(m_Ball.BallIndex); IsComplited = false; }
public MoveDrawTrajectoryAction(BallFacade ball, ITrajectoryDataSource trajectorySource, BallSettings ballSettings) { m_Ball = ball; m_TrajectorySource = trajectorySource; m_WayPoints = m_TrajectorySource.GetWayPoints(m_Ball.BallIndex); MovingPrecision = ballSettings.MovingPrecision; }
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; }