public void Init() { _mocks = Mocks.Init(); _resolver = Mocks.GetResolver(); _resolver.Build(); var updater = new ContainerBuilder(); updater.RegisterInstance(_mocks.Input().Object).As <IInput>(); updater.RegisterInstance(_mocks.AudioSystem().Object).As <IAudioSystem>(); updater.RegisterInstance(new Mock <IMessagePump>().Object); updater.RegisterInstance(new Mock <IRuntimeSettings>().Object); Mock <IUIThread> uiThread = new Mock <IUIThread>(); uiThread.Setup(u => u.RunBlocking(It.IsAny <Action>())).Callback <Action>(a => a()); updater.RegisterInstance(uiThread.Object); updater.Update(_resolver.Container); _textures = new Dictionary <string, ITexture> (); _state = _resolver.Container.Resolve <IGameState>(); _factory = _resolver.Container.Resolve <IGameFactory>(); DesktopFileSystem fileSystem = new DesktopFileSystem(); _saveLoad = new AGSSaveLoad(_resolver, _factory, _textures, _resolver.Container.Resolve <IGame>(), fileSystem); _state.Rooms.Add(_mocks.Room().Object); }
public static Mocks Init() { ContainerBuilder builder = new ContainerBuilder(); Mocks mocks = new Mocks(); builder.RegisterInstance(mocks.Animation().Object); builder.RegisterInstance(mocks.AnimationState().Object); builder.RegisterInstance(mocks.GameState().Object); builder.RegisterInstance(mocks.Game().Object); builder.RegisterInstance(mocks.Player().Object); builder.RegisterInstance(mocks.Character().Object); builder.RegisterInstance(mocks.Room().Object); builder.RegisterInstance(mocks.Object().Object); builder.RegisterInstance(mocks.Viewport().Object); builder.RegisterInstance(mocks.Sprite().Object); builder.RegisterInstance(mocks.Image().Object); builder.RegisterInstance(mocks.Input().Object); builder.RegisterInstance(mocks.Cutscene().Object); builder.RegisterInstance(mocks.RoomTransitions().Object); builder.RegisterInstance(mocks.AudioSystem().Object); builder.RegisterInstance(new Mock <IRenderMessagePump> ().Object); builder.RegisterInstance(new Mock <IUpdateMessagePump>().Object); builder.RegisterInstance(new Mock <IGameEvents>().Object); builder.RegisterInstance(new Mock <IDisplayList>().Object); builder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource()); mocks.container = builder.Build(); return(mocks); }
private IRendererLoop getLoop() { _renderer = new Mock <IImageRenderer>(); return(new AGSRendererLoop(_resolver, _mocks.Game().Object, _renderer.Object, _mocks.Input().Object, new AGSWalkBehindsMap(null), _transitions.Object, new Mock <IGLUtils>().Object)); }
private IDisplayList getDisplayList() { return(new AGSDisplayList(_mocks.GameState().Object, _mocks.Input().Object, new Mock <IMatrixUpdater>().Object, new Mock <IAGSRoomTransitions>().Object)); }
private IRendererLoop getLoop() { _renderer = new Mock <IImageRenderer>(); AGSDisplayList displayList = new AGSDisplayList(_mocks.GameState().Object, _mocks.Input().Object, new AGSWalkBehindsMap(null), _renderer.Object, _events, new Mock <IAGSRoomTransitions>().Object); return(new AGSRendererLoop(_resolver, _mocks.Game().Object, _renderer.Object, _transitions.Object, new Mock <IGLUtils>().Object, new Mock <IGameWindow>().Object, new AGSEvent <DisplayListEventArgs>(), displayList, new Mock <IInput>().Object, new Mock <IMatrixUpdater>().Object)); }