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; }
//ボールのステート遷移 public void StateTransion(IBallState arg_nextState) { if (m_ballState != null) { m_ballState.OnExit(this); } m_ballState = arg_nextState; m_ballState.OnEnter(this); }
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; }
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; }
public BallInput(IBallState ballState) { State = ballState; }
public void GoIntoPlay() { Logger.Info("BallStateMachine: Idle -> Play"); currentState = ballInPlayState; }
public void GoIntoIdle() { Logger.Info("BallStateMachine: Play -> Idle"); currentState = ballInIdleState; }
// Use this for initialization void Start() { currentState = onPaddleState; }
public void goToInGame() { currentState = ballInGameState; }
public void goToInMenu() { currentState = ballInMenuState; }
// +++ unity callbacks ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void Start() { States = CreateStates(); State = States[initialState].SetAsNextState(); }