示例#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;
 }