本文整理汇总了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);
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例7: InitEngine
public void InitEngine()
{
Engine = new Engine();
Engine.RegisterExtension(new RecognitionExtension(), 1);
Map = Map.CreateMap(MapPreset.Small, true);
Engine.Init(Map);
}
示例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;
}
示例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);
}