public void ActionSystems(EntityManager entityManager)
        {
            float         deltaTime  = m_Timer.GetElapsedSeconds();
            List <Entity> entityList = entityManager.Entities();

            foreach (ISystem system in systemList)
            {
                for (int i = 0; i < entityList.Count; i++)
                {
                    system.OnAction(entityList[i], deltaTime);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="e">Provides a snapshot of timing values.</param>
 protected override void OnUpdateFrame(FrameEventArgs e)
 {
     base.OnUpdateFrame(e);
     if (GamePad.GetState(1).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Key.Escape))
     {
         Exit();
     }
     mElaspedTime += mTimer.GetElapsedSeconds();
     if (mElaspedTime > 3)
     {
         mElaspedTime = 0;
         AddEntity();
     }
 }