private void AddDirectionalComponent(DirectionalComponent directionalComponent) { if (!AreEnabledForComponentAndDirection(directionalComponent)) { EnabledDirectionalComponents.Add(directionalComponent); } }
private Action GetAction(DirectionalComponent component) { switch (component.ComponentType) { case eComponentType.Light: return () => ambxEngineWrapper.UpdateLight(component.GetLight()); case eComponentType.Fan: return () => ambxEngineWrapper.UpdateFan(component.GetFan()); case eComponentType.Rumble: return () => ambxEngineWrapper.UpdateRumble(component.GetRumble()); default: throw new ArgumentException("Unexpected Component Type"); } }
public void UpdateComponent(DirectionalComponent component, RunMode runMode) { var action = GetAction(component); switch (runMode) { case RunMode.Asynchronous: ThreadPool.QueueUserWorkItem(_ => action.Invoke()); break; case RunMode.Synchronous: action.Invoke(); break; default: throw new ArgumentException("Unexpected RunMode"); } }
public void UpdateComponent(DirectionalComponent component) { if (component == null) { return; } switch (component.ComponentType) { case eComponentType.Light: UpdateLight((Light)component); break; case eComponentType.Fan: UpdateFan((Fan)component); break; case eComponentType.Rumble: UpdateRumble((Rumble)component); break; } }
public CompositeComponentWrapper(amBXScene scene, DirectionalComponent directionalComponent, AtypicalFirstRunInfiniteTicker ticker) : base(scene, ticker) { DirectionalComponent = directionalComponent; }
public bool AreEnabledForComponentAndDirection(DirectionalComponent directionalComponent) { return EnabledDirectionalComponents .Any(enabledComponent => HasComponentType(enabledComponent, directionalComponent.ComponentType) && HasDirection(enabledComponent, directionalComponent.Direction)); }