示例#1
0
        public IPhase ChangePhase(Situation situation, IPhase phase)
        {
            var oldPhase = _phaseStack.Pop();
            oldPhase.Exit(situation);

            _phaseStack.Push(phase);
            phase.Start(situation);

            return oldPhase;
        }
示例#2
0
        public void SupersedePhase(IPhase newPhase)
        {
            Clock.Stop();

            CurrentPhase.SupersededBy = newPhase;
            newPhase.Supersedes       = CurrentPhase;

            CurrentPhase.Pause();

            CurrentPhase = newPhase;
            CurrentPhase.Start();

            Clock.Start(CurrentPhase.Duration);
        }
示例#3
0
 public void StartPhase(Situation situation, IPhase phase)
 {
     _phaseStack.Push(phase);
     phase.Start(situation);
 }
示例#4
0
文件: Game.cs 项目: mcsoaa/CardGame2
 public void SetPhase(IPhase phase)
 {
     Log.Verbose("Set Phase: " + phase.GetName() + "(" + phase.GetParent() + ")", "Game");
     _phase = phase;
     _phase.Start();
 }