using System.Collections.Generic;

namespace Senzible.Engine
{
    public abstract class Game
    {
        List<GameSystem> Systems = new List<GameSystem>();

        public Game()
        {
            RegisterSystems();
        }

        public abstract void RegisterSystems();

        protected void RegisterSystem(GameSystem gameSystem)
        {
            Systems.Add(gameSystem);
        }

        public void Update(float delta)
        {
            foreach (var gameSystem in Systems)
            {
                gameSystem.Update(delta);
            }
        }

        public void Render(float delta)
        {
            foreach (var gameSystem in Systems)
            {
                gameSystem.Render(delta);
            }
        }
    }
}