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

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

            return oldPhase;
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public void StartPhase(Situation situation, IPhase phase)
 {
     _phaseStack.Push(phase);
     phase.Start(situation);
 }
Esempio n. 4
0
 public void SetPhase(IPhase phase)
 {
     Log.Verbose("Set Phase: " + phase.GetName() + "(" + phase.GetParent() + ")", "Game");
     _phase = phase;
     _phase.Start();
 }