Example #1
0
        /// <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;
        }
Example #2
0
        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>();
        }
Example #3
0
        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);
        }
Example #4
0
 public SystemItemViewModel(IGraphicSystem system)
 {
     this.system      = system;
     Header           = system.ToString().Split('.').Last();
     IsShaderEditable = system is IShadersContainer;
 }
 public void AddSystem(IGraphicSystem sys)
 {
     Systems.AddSystem(sys);
 }
Example #6
0
 public void Change(IGraphicSystem sys)
 {
     App.Current.Dispatcher.BeginInvoke(new Action(() => {
         mv.SystemsView.AddSystem(sys);
     }));
 }
Example #7
0
        public void AddSystem(IGraphicSystem system)
        {
            var item = new SystemItemViewModel(system);

            State.AddItem(item);
        }
Example #8
0
        public override void Initialize(IGraphicSystem graphicSystem, IPhysicSystem physicSystem, ITextSystem textSystem, IInputSystem inputSystem, Action exitAction)
        {
            base.Initialize(graphicSystem, physicSystem, textSystem, inputSystem, exitAction);

            this.OpenScene <MainScene>();
        }