示例#1
0
        public void Initialize(TWEngine engine)
        {
            //testPickupSimulator(engine);
            //testTriggerSimulator(engine);
            //testWayPointTrigger(engine);
            //testWorldmatrixAnimation(engine);
            //testLoadLevel(engine);
            //testLevelBuilding(engine);

            //testAddStupidRedHelperMesh(engine);
            //testFirstPersonCamera(engine);

            TW.Graphics.MouseInputDisabled  = true;
            TW.Graphics.Mouse.CursorEnabled = true;

            var fs = new EngineFileSystem(TWDir.Cache.FullName + "\\EngineFS");

            DI.Set <IEngineFilesystem>(fs);
            DI.Set <EngineTestState>(new EngineTestState(fs));
            DI.Set <TestSceneBuilder>(new TestSceneBuilder(DI.Get <EngineTestState>()));
            DI.Set <UISimulator>(new UISimulator());

            cleanData();
            var initializer = new EngineInitializer(DI.Get <EngineTestState>());

            initializer.SetupEngine(engine);
        }
示例#2
0
        public CakeHost(CakeHostOptions options, CakeHostServices services, ILifetimeScope scope,
                        IFrostingContext context,
                        IEnumerable <IFrostingTask> tasks = null, IFrostingLifetime lifetime = null, IFrostingTaskLifetime taskLifetime = null)
        {
            Guard.ArgumentNotNull(scope, nameof(scope));
            Guard.ArgumentNotNull(services, nameof(services));
            Guard.ArgumentNotNull(context, nameof(context));
            Guard.ArgumentNotNull(options, nameof(options));

            _options      = options;
            _scope        = scope; // Keep the scope alive.
            _context      = context;
            _tasks        = tasks;
            _lifetime     = lifetime;
            _taskLifetime = taskLifetime;

            _environment       = services.Environment;
            _engine            = services.Engine;
            _log               = services.Log;
            _commandFactory    = services.CommandFactory;
            _engineInitializer = services.EngineInitializer;
        }
示例#3
0
        public CakeHost(IFrostingContext context, Container container, CakeHostOptions options,
                        IFileSystem fileSystem, ICakeEnvironment environment, ICakeEngine engine, ICakeLog log,
                        IToolInstaller installer, IEnumerable <PackageReference> tools,
                        EngineInitializer engineInitializer, CommandFactory commandFactory,
                        WorkingDirectory workingDirectory = null, IEnumerable <IFrostingTask> tasks  = null,
                        IFrostingLifetime lifetime        = null, IFrostingTaskLifetime taskLifetime = null)
        {
            Guard.ArgumentNotNull(context, nameof(context));
            Guard.ArgumentNotNull(container, nameof(container));
            Guard.ArgumentNotNull(options, nameof(options));
            Guard.ArgumentNotNull(fileSystem, nameof(fileSystem));
            Guard.ArgumentNotNull(environment, nameof(environment));
            Guard.ArgumentNotNull(engine, nameof(engine));
            Guard.ArgumentNotNull(log, nameof(log));
            Guard.ArgumentNotNull(engineInitializer, nameof(engineInitializer));
            Guard.ArgumentNotNull(commandFactory, nameof(commandFactory));

            // Mandatory arguments.
            _context           = context;
            _container         = container;
            _options           = options;
            _fileSystem        = fileSystem;
            _environment       = environment;
            _engine            = engine;
            _log               = log;
            _installer         = installer;
            _tools             = new List <PackageReference>(tools ?? Enumerable.Empty <PackageReference>());
            _engineInitializer = engineInitializer;
            _commandFactory    = commandFactory;

            // Optional arguments.
            _workingDirectory = workingDirectory;
            _tasks            = tasks;
            _lifetime         = lifetime;
            _taskLifetime     = taskLifetime;
        }
示例#4
0
        public CakeHostServices(ICakeEnvironment environment, ICakeEngine engine, ICakeLog log,
                                EngineInitializer engineInitializer, CommandFactory commandFactory)
        {
            Guard.ArgumentNotNull(environment, nameof(environment));
            Guard.ArgumentNotNull(engine, nameof(engine));
            Guard.ArgumentNotNull(log, nameof(log));
            Guard.ArgumentNotNull(engineInitializer, nameof(engineInitializer));
            Guard.ArgumentNotNull(commandFactory, nameof(commandFactory));

            if (environment == null)
            {
                throw new ArgumentNullException(nameof(environment));
            }
            if (engine == null)
            {
                throw new ArgumentNullException(nameof(engine));
            }
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }
            if (engineInitializer == null)
            {
                throw new ArgumentNullException(nameof(engineInitializer));
            }
            if (commandFactory == null)
            {
                throw new ArgumentNullException(nameof(commandFactory));
            }

            Environment       = environment;
            Engine            = engine;
            Log               = log;
            CommandFactory    = commandFactory;
            EngineInitializer = engineInitializer;
        }