Esempio n. 1
0
 public void runBehaviours(GameLoopPhase phase)
 {
     foreach (IBehaviour behaviour in behaviours
              .Where(x => x.Key == phase)
              .SelectMany(x => x.Value))
     {
         behaviour.doBehaviour(this);
     }
 }
Esempio n. 2
0
 public void run(GameLoopPhase phase)
 {
     // Linq skillz ;)
     foreach (IEntity entity in scenes
              .Where(x => x.Key == game.currentState)
              .SelectMany(x => x.Value))
     {
         entity.runBehaviours(phase);
     }
 }
Esempio n. 3
0
 public void run(GameLoopPhase phase)
 {
     // Linq skillz ;)
     foreach (IEntity entity in scenes
             .Where(x => x.Key == game.currentState)
             .SelectMany(x => x.Value))
     {
         entity.runBehaviours(phase);
     }
 }
Esempio n. 4
0
        public void addBehaviour(GameLoopPhase phase, IBehaviour behaviourToAdd)
        {
            Debug.Assert(verifyAttributes(behaviourToAdd), getMissingAttributes(behaviourToAdd));

            List <IBehaviour> entityBehaviours;

            if (behaviours.TryGetValue(phase, out entityBehaviours))
            {
                entityBehaviours.Add(behaviourToAdd);
            }
            else
            {
                entityBehaviours = new List <IBehaviour>();
                entityBehaviours.Add(behaviourToAdd);
                behaviours.Add(phase, entityBehaviours);
            }
        }
Esempio n. 5
0
        public void PlayerHasEscaped()
        {
            phase = GameLoopPhase.escapedPhase;

            //Pause game, show post game menu, save high score
        }
Esempio n. 6
0
 public void ActivateAlarm()
 {
     phase = GameLoopPhase.alarmedPhase;
 }
Esempio n. 7
0
 public void Init()
 {
     phase = GameLoopPhase.preAlarmPhase;
 }