예제 #1
0
        public PlayBattleState(BattleSceneController BattleSceneControllerRef)
            : base(BattleSceneControllerRef)
        {
            BattleSystem.Get().OnTimerFinished += SetNextState;
            BattleSystem.Get().SetPlayBattleState();

            BattleHud.Get().SetPlayBattleState();
        }
예제 #2
0
        public InitialBattleState(BattleSceneController BattleSceneControllerRef)
            : base(BattleSceneControllerRef)
        {
            BattleHud.Get().SetInitialBattleState();
            BattleSystem.Get().SetInitialBattleState();

            BattleSceneControllerCached.BattleState = new MainBattleState(BattleSceneControllerCached);
        }
예제 #3
0
        private void Start()
        {
            BattleSystem.Get().OnBattleFinished += OnBattleFinished;
            BattleView.Initialize();

            BattleHud.Get().Initialize();

            BattleState = new InitialBattleState(this);
        }
예제 #4
0
        public MainBattleState(BattleSceneController BattleSceneControllerRef)
            : base(BattleSceneControllerRef)
        {
            BattleHud.Get().OnPlayBattleButtonEvent += SetPlayState;
            WindowManager.OnDiscardWindowOpened += SetDiscardState;

            BattleSystem.Get().SetMainBattleState();

            BattleSceneControllerRef.BattleView.SetBattleCardsControlStrategy();
        }
예제 #5
0
        public void RegenerateBoard()
        {
            List <CardWrapper> alliedCards = null;

            alliedCards = BoardCached.AlliedTimeline?.RemoveCardsFromTimeline();

            BoardCached.RegenerateTimelinesAndTimerView();

            if (alliedCards != null)
            {
                foreach (CardWrapper card in alliedCards)
                {
                    if (!BoardCached.AlliedTimeline.TryAddCard(card))
                    {
                        HandCached.AddCard(card);
                    }
                }
            }

            BattleHud.Get().UpdateStatuses(GetStatusPosition(BoardCached.AlliedTimeline),
                                           GetStatusPosition(BoardCached.EnemyTimeline));
        }
예제 #6
0
 public LoseBattleState(BattleSceneController BattleSceneControllerRef)
     : base(BattleSceneControllerRef)
 {
     BattleSystem.Get().StopBattleTimer();
     BattleHud.Get().OpenWindow <LoseWindow>();
 }
예제 #7
0
 private void UnsubscribeAll()
 {
     BattleHud.Get().OnPlayBattleButtonEvent -= SetPlayState;
     WindowManager.OnDiscardWindowOpened -= SetDiscardState;
 }