/// <summary> /// Initializes the specified graphic system. /// </summary> /// <param name="graphicSystem">The graphic system.</param> /// <param name="physicSystem">The physic system.</param> /// <param name="textSystem">The text system.</param> /// <param name="inputSystem">The input system.</param> /// <param name="exitAction">The exit action.</param> public virtual void Initialize( IGraphicSystem graphicSystem, IPhysicSystem physicSystem, ITextSystem textSystem, IInputSystem inputSystem, Action exitAction) { Components = new List <IComponent>(); _componentsToRemove = new List <IComponent>(); _updatables = new List <IUpdatable>(); _drawables = new List <IDrawable>(); _time = new Time(); _pendingSceneToOpen = new NullScene(this); graphicSystem.Initialize(); textSystem.Initialize(); _drawContext = new DrawContext(graphicSystem, textSystem); GraphicSystem = graphicSystem; Bounds = Bounds == Rectangle.Zero ? graphicSystem.Bounds : Bounds; PhysicSystem = physicSystem; LogSystem = new NullLogSystem(); FontSystem = textSystem; InputSystem = inputSystem; this._exitAction = exitAction; }
private bool disposed = false; // To detect redundant calls public override void Initialize( IGraphicSystem graphicSystem, IPhysicSystem physicSystem, ITextSystem textSystem, IInputSystem inputSystem, Action exitAction) { var b = graphicSystem.Bounds; Bounds = new Rectangle(b.Left + 5, b.Top + 10, b.Width - 10, b.Height - 10); base.Initialize(graphicSystem, physicSystem, textSystem, inputSystem, exitAction); this.OpenScene <ClassicModeLevelScene>(); }
public void InitializeTest() { exited = false; graphicSystem = Substitute.For <IGraphicSystem>(); physicSystem = Substitute.For <IPhysicSystem>(); var textSystem = Substitute.For <ITextSystem>(); var inputSystem = Substitute.For <IInputSystem>(); textSystem.GetFont(null).ReturnsForAnyArgs(Substitute.For <IFont>()); textSystem.Context.Returns(Substitute.For <IWorldContext>()); var logSystem = Substitute.For <ILogSystem>(); target = new World(); target.Initialize(graphicSystem, physicSystem, textSystem, inputSystem, () => exited = true); }
public SystemItemViewModel(IGraphicSystem system) { this.system = system; Header = system.ToString().Split('.').Last(); IsShaderEditable = system is IShadersContainer; }
public void AddSystem(IGraphicSystem sys) { Systems.AddSystem(sys); }
public void Change(IGraphicSystem sys) { App.Current.Dispatcher.BeginInvoke(new Action(() => { mv.SystemsView.AddSystem(sys); })); }
public void AddSystem(IGraphicSystem system) { var item = new SystemItemViewModel(system); State.AddItem(item); }
public override void Initialize(IGraphicSystem graphicSystem, IPhysicSystem physicSystem, ITextSystem textSystem, IInputSystem inputSystem, Action exitAction) { base.Initialize(graphicSystem, physicSystem, textSystem, inputSystem, exitAction); this.OpenScene <MainScene>(); }