当前位置: 首页>>代码示例>>C#>>正文


C# Engine.Init方法代码示例

本文整理汇总了C#中Engine.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.Init方法的具体用法?C# Engine.Init怎么用?C# Engine.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Engine的用法示例。


在下文中一共展示了Engine.Init方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitEngine

        public void InitEngine()
        {
            Engine = new Engine(resolver);
            Map = Map.CreateMap(20, 20, true);
            Engine.Init(Map);
            Pos = new Vector2(25, 25);

            Item = new DummyItem(resolver, Pos);
        }
开发者ID:FrankFlamme,项目名称:AntMeCore,代码行数:9,代码来源:ItemTest.cs

示例2: Run

        public void Run()
        {
            var engine = new Engine();

            this.RegisterHandlers(engine);
            engine.Init();

            engine.Start();

            while (true)
            {
                var input = Console.ReadLine().ToLower();
                if (input.Equals("exit"))
                {
                    break;
                }
            }
        }
开发者ID:goosefraba19,项目名称:ktane-abe,代码行数:18,代码来源:App.cs

示例3: GUI

        public GUI(string textureName, string defaultFontName, int defaultFontSize)
        {
            PlatformManager = new PlatformManager(CreateWxPlatformManager());

            Engine = new Engine(PlatformManager);
            Engine.Init();

            // Search for the location of the main assets folder.
            string assetsPath;
            if (!SearchForAssetsDirectory(out assetsPath))
                throw new Exception("Editor assets were not found");

            Archive = new ArchiveVirtual();
            Archive.MountDirectories(assetsPath, Allocator.GetHeap());

            ResourceManager = Engine.ResourceManager;
            ResourceManager.Archive = Archive;

            WindowManager = Engine.WindowManager;

            MainWindow = CreateWindow();
            var context = MainWindow.CreateContext(new RenderContextSettings());

            MainView = MainWindow.CreateView();
            MainView.ClearColor = Color.Red;

            MainWindow.MakeCurrent();
            context.Init();

            RenderDevice = Engine.RenderDevice;
            RenderDevice.ActiveView = MainView;

            var options = new ResourceLoadOptions {Name = textureName, AsynchronousLoad = false};
            var imageHandle = ResourceManager.LoadResource<Image>(options);
            if (imageHandle.Id == 0)
                return;

            Renderer = new GwenRenderer();
            Skin = new TexturedSkin(Renderer, imageHandle, new Flood.GUI.Font(defaultFontName, defaultFontSize));

            if (!Directory.Exists(StoredValuesDirectory))
                Directory.CreateDirectory(StoredValuesDirectory);
        }
开发者ID:chartly,项目名称:flood,代码行数:43,代码来源:GUI.cs

示例4: EditorBase

        public EditorBase()
        {
            PlatformManager = new PlatformManager(CreateWxPlatformManager());

            Engine = new Engine(PlatformManager);
            Engine.Init();

            // Search for the location of the main assets folder.
            string assetsPath;
            if (!SearchForAssetsDirectory(out assetsPath))
                throw new Exception("Editor assets were not found");

            Archive = new ArchiveVirtual();
            Archive.MountDirectories(assetsPath, Allocator.GetHeap());

            ResourceManager = Engine.ResourceManager;
            ResourceManager.Archive = Archive;

            EditorWindow = new EditorWindow();

            WindowManager = Engine.WindowManager;

            MainWindow = CreateWindow();
            var context = MainWindow.CreateContext(new RenderContextSettings());

            MainView = MainWindow.CreateView();
            MainView.ClearColor = Color.Red;

            MainWindow.Idle += Update;
            MainWindow.Render += Render;
            MainWindow.TargetResize += Resize;
            MainWindow.Show(true);

            MainWindow.MakeCurrent();
            context.Init();

            RenderDevice = Engine.RenderDevice;
        }
开发者ID:chartly,项目名称:flood,代码行数:38,代码来源:EditorBase.cs

示例5: Application

        public Application()
        {
            PlatformManager = new PlatformManager(CreateWxPlatformManager());

            Engine = new Engine(PlatformManager);
            Engine.Init();

            // Search for the location of the main assets folder.
            string assetsPath;
            if (!SearchForAssetsDirectory(out assetsPath))
                throw new Exception("Editor assets were not found");

            Archive = new ArchiveVirtual();
            Archive.MountDirectories(assetsPath, Allocator.GetHeap());

            ResourceManager = Engine.ResourceManager;
            ResourceManager.Archive = Archive;

            NativeWindowManager = Engine.WindowManager;

            RenderDevice = Engine.RenderDevice;

            ModuleManager = new ModuleManager();

            RemotingManager = new RemotingManager(ModuleManager);

            ModuleManager.Init(RemotingManager.ServiceManager);

            //Initiate global services
            WindowManager = new Windows.WindowManager(this);

            RemotingManager.ServiceManager.GetCreateImplementation<IWindowManager>(WindowManager);

            // FIXME: Introduce a better system to get at global objects (dependency injection?)
            RemotingManager.ServiceManager.Application = this;
        }
开发者ID:FloodProject,项目名称:flood,代码行数:36,代码来源:Application.cs

示例6: CreateEngine

		/// <summary>
		/// Creates the engine and sets all event handlers.
		/// </summary>
		/// <returns>The engine.</returns>
		/// <param name="cart">Cart.</param>
		public void CreateEngine (Cartridge cart)
		{
			var helper = new AndroidPlatformHelper(ApplicationContext);
			helper.Ctrl = this;

			engine = new Engine (helper);

			// Set all events for engine
			engine.AttributeChanged += OnAttributeChanged;
			engine.InventoryChanged += OnInventoryChanged;
			engine.ZoneStateChanged += OnZoneStateChanged;
			engine.CartridgeCompleted += OnCartridgeComplete;
			engine.InputRequested += OnGetInput;
			engine.LogMessageRequested += OnLogMessage;
			engine.PlayAlertRequested += OnPlayAlert;
			engine.PlayMediaRequested += OnPlayMedia;
			engine.SaveRequested += OnSaveCartridge;
			engine.ShowMessageBoxRequested += OnShowMessageBox;
			engine.ShowScreenRequested += OnShowScreen;
			engine.ShowStatusTextRequested += OnShowStatusText;
			engine.StopSoundsRequested += OnStopSound;

			// If there is a old logFile, close it
			if (logFile != null) {
				logFile.Flush ();
				logFile.Close ();
			}

			// Open logFile first time
			logFile = new StreamWriter(cart.LogFilename, true, System.Text.Encoding.UTF8);
			logFile.AutoFlush = true;

			// Open GPX file for the first time
//			if (!String.IsNullOrEmpty(cartridge.GpxFilename)) {
//				// Create new Gpx object
//				gpxFile = new GpxClass ();
//
//				if (File.Exists (cartridge.SaveFilename)) {
//					// Get existing data
//					gpxFile.FromFile (cartridge.SaveFilename);
//					if (gpxFile.trk == null)
//						gpxFile.trk = new trkTypeCollection ();
//				} else {
//					// Create new Gpx file
//					gpxFile.metadata = new metadataType () {
//						author=new personType(){name=WindowsIdentity.GetCurrent().Name},
//						link=new linkTypeCollection().AddLink(new linkType(){ href="www.BlueToque.ca",  text="Blue Toque Software" })
//					};
//					gpxFile.trk = new trkTypeCollection ();
//				}

				// Create new track segment
//				gpxFile.trk.trksgt = new trksegTypeCollection ();
//				gpxFile.trk.trksgt
//			}

			engine.Init (new FileStream (cart.Filename,FileMode.Open), cart);
		}
开发者ID:WFoundation,项目名称:WF.Player.Android,代码行数:63,代码来源:GameController.cs

示例7: InitEngine

 public void InitEngine()
 {
     Engine = new Engine();
     Engine.RegisterExtension(new RecognitionExtension(), 1);
     Map = Map.CreateMap(MapPreset.Small, true);
     Engine.Init(Map);
 }
开发者ID:FrankFlamme,项目名称:AntMeCore,代码行数:7,代码来源:RecognitionExtensionTest.cs

示例8: createEngine

		private Engine createEngine (Cartridge cart)
		{
			Engine result;

			result = new Engine ();

			// Set all events for engine
			result.GetInputEvent += OnGetInput;
			result.LogMessageEvent += OnLogMessage;
			result.NotifyOSEvent += OnNotifyOS;
			result.PlayMediaEvent += OnPlayMedia;
			result.ShowMessageEvent += OnShowMessage;
			result.ShowScreenEvent += OnShowScreen;
			result.ShowStatusTextEvent += OnShowStatusText;
			result.SynchronizeEvent += OnSynchronize;

			// If there is a old logFile, close it
			if (logFile != null) {
				logFile.Flush ();
				logFile.Close ();
			}

			// Open logFile first time
			logFile = new StreamWriter(cart.LogFilename, true, Encoding.UTF8);
			logFile.AutoFlush = true;

			result.Init (new FileStream (cart.Filename,FileMode.Open), cart);

			return result;
		}
开发者ID:jonny65,项目名称:WF.Player.Android,代码行数:30,代码来源:ScreenActivity.cs

示例9: CreateEngine

		public void CreateEngine (Cartridge cart)
		{
			if (engine != null)
				DestroyEngine ();

			var helper = new iOSPlatformHelper ();
			helper.Ctrl = this;

			engine = new Engine (helper);

			// Set all events for engine
			engine.AttributeChanged += OnAttributeChanged;
			engine.InventoryChanged += OnInventoryChanged;
			engine.ZoneStateChanged += OnZoneStateChanged;
			engine.CartridgeCompleted += OnCartridgeComplete;
			engine.InputRequested += OnGetInput;
			engine.LogMessageRequested += OnLogMessage;
			engine.PlayAlertRequested += OnPlayAlert;
			engine.PlayMediaRequested += OnPlayMedia;
			engine.SaveRequested += OnSaveCartridge;
			engine.ShowMessageBoxRequested += OnShowMessageBox;
			engine.ShowScreenRequested += OnShowScreen;
			engine.ShowStatusTextRequested += OnShowStatusText;
			engine.StopSoundsRequested += OnStopSound;

			// If there is a old logFile, close it
			if (logFile != null) {
				logFile.Flush ();
				logFile.Close ();
			}

			// Open logFile first time
			logFile = new StreamWriter(cart.LogFilename, true, System.Text.Encoding.UTF8);

			engine.Init (new FileStream (cart.Filename,FileMode.Open), cart);
		}
开发者ID:WFoundation,项目名称:WF.Player.iOS,代码行数:36,代码来源:ScreenController.cs


注:本文中的Engine.Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。