コード例 #1
0
        public bool IsEqualTo(eeObject obj)
        {
            // eeNumber has a separate object comparason
            if (this.type == eeObjectType.NUMBER && obj.type == eeObjectType.NUMBER)
            {
                return(((eeNumber)this.value) == ((eeNumber)obj.value));
            }
            else if (this.type == eeObjectType.LIST && obj.type == eeObjectType.LIST)
            {
                List <eeObject> listA = this.AsList(),
                                listB = obj.AsList();

                if (listA.Count() != listB.Count())
                {
                    return(false);
                }

                for (int i = 0; i < listA.Count(); i++)
                {
                    if (listA[i].IsNotEqualTo(listB[i]))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            else // all other underlying native c# objects can be compared as usual
            {
                return(this.type == obj.type && this.value.Equals(obj.value));
            }
        }