public void AddComponentToEntity(IEngineComponent component, uint id) { if (!Components.ContainsKey(component.GetType())) { Components.Add(component.GetType(), new Dictionary <uint, IEngineComponent>()); } var components = Components[component.GetType()]; components.Add(id, component); }
public Train(int id, string name, int maxSpeed, bool operated, ILogComponent trainLog, IEngineComponent engineComponent, IPassengerCartComponent passengerCartComponent) { this.ID = id; this.Name = name; this.MaxSpeed = maxSpeed; this.Operated = operated; this.LogComponent = trainLog; this.EngineComponent = engineComponent; this.PassengerCartComponent = passengerCartComponent; }
private void AddComponent(IEngineComponent component, bool delayStartUp) { Engine.Log.Write("Adding sub-system:"); Engine.Log.IndentMore(); Engine.Log.Write("* " + component.GetType().Name); Engine.Log.IndentMore(); m_components.Add(component); if (!delayStartUp) { component.Startup(); component.Started = true; } Engine.Log.IndentLess(); Engine.Log.IndentLess(); }
private static void OnComponentRemoved(IEngineComponent component) { GameLoop loop = component as GameLoop; if (loop != null) { OnGameLoopRemoved(loop); } if (component is Renderer) { OnRendererRemoved(); } Logger logger = component as Logger; if (logger != null) { OnLoggerRemoved(logger); } }
private static void OnComponentAdded(IEngineComponent component) { GameLoop loop = component as GameLoop; if (loop != null) { OnGameLoopAdded(loop); } Renderer renderer = component as Renderer; if (renderer != null) { OnRendererAdded(renderer); } Logger logger = component as Logger; if (logger != null) { OnLoggerAdded(logger); } }
public RemoteCollectorEngineInitiator( int engineId, string engineName, bool interfaceAvailable, IEngineDAL engineDal, IThrottlingStatusProvider throttlingStatusProvider, IEngineComponent engineComponent) { if (engineName == null) { throw new ArgumentNullException(nameof(engineName)); } IEngineDAL iengineDal = engineDal; if (iengineDal == null) { throw new ArgumentNullException(nameof(engineDal)); } this._engineDal = iengineDal; IThrottlingStatusProvider ithrottlingStatusProvider = throttlingStatusProvider; if (ithrottlingStatusProvider == null) { throw new ArgumentNullException(nameof(throttlingStatusProvider)); } this._throttlingStatusProvider = ithrottlingStatusProvider; IEngineComponent engineComponent1 = engineComponent; if (engineComponent1 == null) { throw new ArgumentNullException(nameof(engineComponent)); } this._engineComponent = engineComponent1; this.EngineId = engineId; this.ServerName = engineName.ToUpperInvariant(); this._interfaceAvailable = interfaceAvailable; }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return(IsCompatibleTo(component)); }
protected abstract bool IsCompatibleTo(IEngineComponent component);
protected override bool IsCompatibleTo(IEngineComponent component) { return(!(component is Mouse)); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return true; }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return(true); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return(!(component is GameLoop)); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return !(component is Renderer); }
public void UnregisterEngineComponent(IEngineComponent component) { if (component is IUpdateable) OnUpdate -= (component as IUpdateable).Update; if (component is IRenderable) OnRender -= (component as IRenderable).Render; if (component is ILoadable) { OnLoadContent -= (component as ILoadable).LoadContent; OnUnloadContent -= (component as ILoadable).UnloadContent; } if(component is IHandleMouseButtonPressed) OnMousePressed -= (component as IHandleMouseButtonPressed).OnMousePressed; if(component is IHandleMouseButtonHeld) OnMouseHeld -= (component as IHandleMouseButtonHeld).OnMouseHeld; if(component is IHandleMouseButtonReleased) OnMouseReleased -= (component as IHandleMouseButtonReleased).OnMouseReleased; if (component is IHandleMouseMotion) OnMouseMoved -= (component as IHandleMouseMotion).OnMotion; if (component is IHandleMousePosition) OnMousePosition -= (component as IHandleMousePosition).OnPosition; if (component is IHandleMouseScrollWheel) OnMouseScroll -= (component as IHandleMouseScrollWheel).OnScrolled; if (component is IHandleKeyboardPressed) OnKeyboardPressed -= (component as IHandleKeyboardPressed).OnKeyboardPressed; if (component is IHandleKeyboardHeld) OnKeyboardHeld -= (component as IHandleKeyboardHeld).OnKeyboardHeld; if (component is IHandleKeyboardReleased) OnKeyboardReleased -= (component as IHandleKeyboardReleased).OnKeyboardReleased; }
protected override bool IsCompatibleTo(IEngineComponent component) { return !(component is DebugConsole); }
protected override bool IsCompatibleTo(IEngineComponent component) { return(true); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return IsCompatibleTo(component); }
protected override bool IsCompatibleTo(IEngineComponent component) { return true; }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return(!(component is Renderer)); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return !(component is AudioEngine); }
public void AddComponent(IEngineComponent Component) { Components.Add(Component); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return !(component is GameLoop); }
public void AddComponent(IEngineComponent component) { AddComponent(component, false); }
protected override bool IsCompatibleTo(IEngineComponent component) { return(!(component is VisualStudioTrace)); }
bool IEngineComponent.IsCompatibleTo(IEngineComponent component) { return(!(component is AudioEngine)); }
public void AddComponentDelayed(IEngineComponent component) { AddComponent(component, true); }
protected override bool IsCompatibleTo(IEngineComponent component) { return(!(component is DebugConsole)); }
protected override bool IsCompatibleTo(IEngineComponent component) { return !(component is VisualStudioTrace); }