コード例 #1
0
        /// <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)
                 ));
        }
コード例 #2
0
 DomainRef GetDomainObjById(RefId id)
 {
     // TODO: optimize
     return(FindObjectsOfType <DomainRef>()
            .Where(i => i.id.Equals(id))
            .First());
 }
コード例 #3
0
ファイル: Naming.cs プロジェクト: Jasper-Hilven/DarkFrog
        public static RefId GetNamedId(string name)
        {
            var retId = RefId.CreateRefId();

            retId.SetProperty(nameTag, StringId.CreateStringId(name));
            return(retId);
        }
コード例 #4
0
        public static IId getCombinedFunctionDefinition(IId parameterSet, IId functionCallList)
        {
            var ret = RefId.CreateRefId();

            ret.SetProperty(parameters, parameterSet);
            ret.SetProperty(subFunctionCalls, functionCallList);
            return(ret);
        }
コード例 #5
0
        public static IId GetFunctionCall(IId valueDictionary, IId callee)
        {
            var ret = RefId.CreateRefId();

            ret.SetProperty(parameterValues, valueDictionary);
            ret.SetProperty(functionCalled, callee);
            return(ret);
        }
コード例 #6
0
ファイル: IIdStreamer.cs プロジェクト: Jasper-Hilven/DarkFrog
        public RefId RegisterAndCreateUniqueIId(string uniqueName)
        {
            if (environment.NameToId.ContainsKey(uniqueName))
            {
                throw new Exception();
            }
            var ret = RefId.CreateRefId();

            environment.NameToId.Add(uniqueName, ret);
            return(ret);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: IIdStreamer.cs プロジェクト: Jasper-Hilven/DarkFrog
        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);
        }
コード例 #10
0
 /// <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);
     }
 }
コード例 #11
0
 public override int GetHashCode()
 {
     return(RefId?.GetHashCode() ?? 0);
 }