public async Task <ISchema?> GetSchemaByIdAsync( Guid id, CancellationToken cancellationToken = default) { Component?component = await GetByIdAsync(id, cancellationToken); if (component?.Schema is null) { return(null); } return(_schemaService.CreateSchema(component.Schema)); }
internal Percolator(List <Axis <T> > axis, List <MdxComponent> components) { this._cube = typeof(T).GetCubeInstance <T>(); this._setDepth = 0; this._memberDepth = 0; this._sb = new StringBuilder(); this._translations = new List <Translation>(); this._components = components; this._axis = axis; this._currentAxis = axis.Count == 0 ? (byte)0 : axis.Min(x => x.AxisNumber); this._currentComponent = null; this.MdxCommand = this.translate(); }
internal Percolator(List <Axis <object> > axis, List <ScoopComponent> components) { // _cube = typeof(T).GetCubeInstance<T>(); _setDepth = 0; _memberDepth = 0; _translations = new List <Translation>(); _components = components; _axis = axis; _currentAxis = axis.Count == 0 ? (byte)0 : axis.Min(x => x.AxisNumber); _currentComponent = null; _parameter = new List <SqlParameter>(); ScoopCommand = translate(); }
public static Component?AddComponent(this Entity entity, Type componentType) { if (IsComponent(componentType) && EntityExists(entity)) { Component?c = ApiProvider.AddComponentToScene(entity, componentType); if (c == null) { throw new SynthesisException($"Failed to add component of type {componentType.FullName} to entity"); } components.Set(entity.Index, entity.Gen, c); return(c); } return(null); }
string translate() { try { var baseName = new[] { "Object", "BaseEntity" }; string from = ""; if (baseName.Contains(typeof(T).BaseType.Name)) { from = typeof(T).Name; } else { from = typeof(T).BaseType.Name; } _translations.Add(new Translation(_FROM, string.Format("FROM [{0}] WITH(NOLOCK) ", from))); } catch (NullReferenceException e) { throw new PercolatorException(string.Format("The cube type of '{0}' is not queryable", typeof(T).Name)); } _axis.ForEach(axis => { _currentAxis = axis.AxisNumber; _currentAxisObject = axis; Evaluate(axis.Creator); }); _currentAxis = 190; _components.Where(w => w.ComponentType != Component.Paggin).ForEach(component => { _currentComponent = component.ComponentType; _currentAxis = getComponentValue(component.ComponentType); Evaluate(component.Creator, component.Entity, component.DataTablesRequest); }); var scoopPaging = _components.Where(x => x.ScoopPagging != null).Select(x => x.ScoopPagging).FirstOrDefault(); if (scoopPaging != null) { _currentComponent = Component.Paggin; Evaluate(scoopPaging); } return(assembleTranslations()); }
public void Render(GameObject obj, Component?oldComp) { if (oldComp == null) { var camera = obj.AddComponent <Camera>(); camera.pixelRect = viewport; } else if (oldComp is CameraComponent old && !old.Equals(this)) { var camera = obj.GetComponent <Camera>(); if (old.viewport != viewport) { camera.pixelRect = viewport; } } }
/// <summary> /// Component indexer /// </summary> /// <param name="index">The index into this collection</param> internal new Component this[int index] { get { Component?component = null; if (index < this.Count) { component = base[index]; } return(component !); } set { base[index] = value; } }
public void Render(GameObject obj, Component?oldComp) { if (oldComp == null) { var boxCollider = obj.AddComponent <BoxCollider>(); } else if (oldComp is BoxColliderComponent old && !old.Equals(this)) { var boxCollider = obj.GetComponent <BoxCollider>(); if (old.center != center) { boxCollider.center = center; } if (old.size != size) { boxCollider.size = size; } } }
public override bool Create(Editor.Editor editor, [NotNullWhen(true)] out Component?component) { ImGui.SetNextItemWidth(80); if (ImGui.InputInt("Bits", ref this.bits, 1, 1)) { this.bits = Math.Max(2, this.bits); } ImGui.Button("Create"); if (ImGui.IsItemClicked()) { ImGui.CloseCurrentPopup(); component = new LogicGate(editor.GetWorldMousePos(), this.bits, this.logic); return(true); } component = null; return(false); }
private void KMGameInfo_OnStateChange(KMGameInfo.State state) { if (state == KMGameInfo.State.Gameplay) { // Enabling Show Module Names is considered an advantageous feature, so disable records in that case. // This code is based on the Tweaks mod. if (this.config.ShowModuleNames) { LeaderboardController.DisableLeaderboards(); } this.StartCoroutine(this.CheckForBombs()); } else if (state == KMGameInfo.State.Transitioning && this.gameState == KMGameInfo.State.Setup) { this.KMModSettings.RefreshSettings(); this.RefreshConfig(); } else if (state == KMGameInfo.State.Setup) { this.popups.Clear(); if (this.tweaksService == null) { Debug.Log("[Profile Revealer] Looking for Tweaks service..."); var obj = GameObject.Find("Tweaks(Clone)"); if (obj != null) { this.tweaksService = obj.GetComponent("Tweaks"); } if (this.tweaksService != null) { Debug.Log("[Profile Revealer] Found Tweaks service."); } else { Debug.Log("[Profile Revealer] Did not find Tweaks service."); LeaderboardController.Install(); } } } this.gameState = state; }
public void Render(GameObject obj, Component?oldComp) { if (oldComp == null) { var sphereCollider = obj.AddComponent <SphereCollider>(); sphereCollider.center = center; sphereCollider.radius = radius; } else if (oldComp is SphereColliderComponent old && !old.Equals(this)) { var sphereCollider = obj.GetComponent <SphereCollider>(); if (old.center != center) { sphereCollider.center = center; } if (old.radius != radius) { sphereCollider.radius = radius; } } }
public VersionCommand(Component?component = null) { Component = component; }
public abstract bool Create(Editor.Editor editor, [NotNullWhen(true)] out Component?component);
public bool Equals(Component?other) { return(Component.Equals(this, other)); }
public bool TryGetComponentByID(string id, [NotNullWhen(true)] out Component?comp) { comp = AllComponents.FirstOrDefault(x => x.UniqueID == id, null); return(comp != null); }
/// <summary> /// Creates a new event handler list. The parent component is used to check the /// component's CanRaiseEvents property. /// </summary> internal EventHandlerList(Component parent) { _parent = parent; }
public bool Equals(Component?other) => other is not null && (other.GetType() == GetType());