Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
            }
        }
Exemplo n.º 5
0
        public void PlayerHasEscaped()
        {
            phase = GameLoopPhase.escapedPhase;

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