public BallController(IBall spriteEntity, IGameManager gameManager):base(gameManager)
 {
     Ball = spriteEntity;
     State = new StartBallState(this, gameManager, PlayerIndex.One);
     View = new BallView(Ball, this );
     GameScore = GameManager["GameScore"] as GameScore;
 }
Exemple #2
0
 //ボールのステート遷移
 public void StateTransion(IBallState arg_nextState)
 {
     if (m_ballState != null)
     {
         m_ballState.OnExit(this);
     }
     m_ballState = arg_nextState;
     m_ballState.OnEnter(this);
 }
Exemple #3
0
        public BallStateMachine(
            ILifetimeScope scope,
            ICollection <IBrick> bricks,
            Action <IBall, IEnumerable <int> > handleBrickCollision,
            Action lostBalls)
        {
            ballInPlayState = new BallInPlayState(scope, bricks, handleBrickCollision, lostBalls);
            ballInIdleState = new BallInIdleState(scope);

            currentState = ballInIdleState;
        }
Exemple #4
0
        public BallStateMachine(Game game,
                                IScreenCollisionManager screenCollisionManager,
                                ICollisionManager collisionManager,
                                IPadManager padManager,
                                IBorderManager borderManager,
                                ILevelManager levelManager)
        {
            ballInGameState = new BallInGameState(game, screenCollisionManager, collisionManager, padManager, borderManager, levelManager);
            ballInMenuState = new BallInMenuState(game, padManager);

            currentState = ballInMenuState;
        }
 public BallController(IBall spriteEntity, IBallState ballState, IGameManager gameManager)
 {
     Ball = spriteEntity;
     State = ballState;
     GameManager = gameManager;
 }
Exemple #6
0
 public BallInput(IBallState ballState)
 {
     State = ballState;
 }
Exemple #7
0
 public void GoIntoPlay()
 {
     Logger.Info("BallStateMachine: Idle -> Play");
     currentState = ballInPlayState;
 }
Exemple #8
0
 public void GoIntoIdle()
 {
     Logger.Info("BallStateMachine: Play -> Idle");
     currentState = ballInIdleState;
 }
Exemple #9
0
 // Use this for initialization
 void Start()
 {
     currentState = onPaddleState;
 }
Exemple #10
0
 public void goToInGame()
 {
     currentState = ballInGameState;
 }
Exemple #11
0
 public void goToInMenu()
 {
     currentState = ballInMenuState;
 }
 // +++ unity callbacks ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void Start()
 {
     States = CreateStates();
     State  = States[initialState].SetAsNextState();
 }