/// <summary> /// Returns true if UnitReferenceDataResponse instances are equal /// </summary> /// <param name="other">Instance of UnitReferenceDataResponse to be compared</param> /// <returns>Boolean</returns> public bool Equals(UnitReferenceDataResponse other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( RefId == other.RefId || RefId != null && RefId.Equals(other.RefId) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( UnitSite == other.UnitSite || UnitSite != null && UnitSite.Equals(other.UnitSite) )); }
DomainRef GetDomainObjById(RefId id) { // TODO: optimize return(FindObjectsOfType <DomainRef>() .Where(i => i.id.Equals(id)) .First()); }
public static RefId GetNamedId(string name) { var retId = RefId.CreateRefId(); retId.SetProperty(nameTag, StringId.CreateStringId(name)); return(retId); }
public static IId getCombinedFunctionDefinition(IId parameterSet, IId functionCallList) { var ret = RefId.CreateRefId(); ret.SetProperty(parameters, parameterSet); ret.SetProperty(subFunctionCalls, functionCallList); return(ret); }
public static IId GetFunctionCall(IId valueDictionary, IId callee) { var ret = RefId.CreateRefId(); ret.SetProperty(parameterValues, valueDictionary); ret.SetProperty(functionCalled, callee); return(ret); }
public RefId RegisterAndCreateUniqueIId(string uniqueName) { if (environment.NameToId.ContainsKey(uniqueName)) { throw new Exception(); } var ret = RefId.CreateRefId(); environment.NameToId.Add(uniqueName, ret); return(ret); }
public static RefId CreateList(IId[] elements) { var list = RefId.CreateRefId(); var rawList = BareListId.CreateBareListId(); list.SetProperty(listId, rawList); for (int i = 0; i < elements.Length; i++) { rawList.SetProperty(IntId.CreateId(i), elements[i]); } return(list); }
public static IId CreateSet(ISet <IId> values) { var set = RefId.CreateRefId(); var rawSet = BareSetId.CreateBareSetId(); set.SetProperty(setId, rawSet); foreach (var value in values) { set.SetProperty(value, value); } return(set); }
public IEnumerable <string> StreamAllIIds() { var isStreaming = RefId.CreateRefId(); var streamList = new List <string>() { "IID" }; AddIdAndMark(environment.GetRoot(), streamList, isStreaming); UnMark(environment.GetRoot(), isStreaming); streamList.Add("NAMES"); WriteUniqueNames(environment.NameToId, streamList); return(streamList); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (RefId != null) { hashCode = hashCode * 59 + RefId.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { return(RefId?.GetHashCode() ?? 0); }