コード例 #1
0
ファイル: MagicEngine.cs プロジェクト: jpbruyere/MagicCrow
        public void Process()
        {
            //temp fix to have begin not handle before end event in Magic
            //but those kind of sync problem will surely rise
            if (raiseBeginPhase)
            {
                raiseBeginPhase = false;
                MagicEvent(new PhaseEventArg {
                    Type   = MagicEventType.BeginPhase,
                    Phase  = _currentPhase,
                    Player = Players [currentPlayerIndex]
                });
            }

            //animate only if cards are loaded
            if (!DecksLoaded)
            {
                DecksLoaded = Players.Where(p => !p.DeckLoaded).Count() == 0;
                if (DecksLoaded)
                {
                    CardInstance.Create3DCardsTextureAndVBO();
                    Players[0].CurrentState = Player.PlayerStates.InitialDraw;
                    Players[1].CurrentState = Player.PlayerStates.InitialDraw;
                }
            }

            MagicStack.CheckLastActionOnStack();

            foreach (Player p in Players)
            {
                p.Process();
            }

            if (pp.PhaseDone)
            {
                GivePriorityToNextPlayer();
            }
        }