public GameManager(RenderAdapter renderAdapter, IUtilsAdapter utilsAdapter, IInputAdapter inputAdapter, IResourceAdapter resoruceAdapter) { _graphics = new GraphicsManager(renderAdapter); Utils.SetAdapter(utilsAdapter); _input = new InputManger(inputAdapter); ResoruceManger.SetAdapter(resoruceAdapter); SetUpGameWindow(); LoadFonts(); _world = new World(_factory, _settings.BackgroundMusicFileName); _ui = new UserInterfaceManger(_factory, _world); Statistics.SetWorld(_world); // Must be called After adapters are set _collsion = new CollsionManger(); _sound = new SoundManger(); }
public static void SetAdapter(IUtilsAdapter adapter) { _utilsAdapter = adapter ?? throw new NullReferenceException(); }