Exemple #1
0
        public override bool Equals(NeoValue value, bool deep)
        {
            var mm = GetMetaMethod("__equals", value);

            if (mm != null)
            {
                var r = mm.Call(new [] { this, value, NeoBool.ValueOf(deep) });
                return(r.CheckBool().Value);
            }
            else
            {
                if (!value.IsObject)
                {
                    return(false);
                }

                var other = value.CheckObject();
                if (other.data.Count != data.Count)
                {
                    return(false);
                }

                if (deep)
                {
                    foreach (var mapping in data)
                    {
                        if (!mapping.Value.Equals(other.Get(mapping.Key), true))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
                else
                {
                    return(this == other);
                }
            }
        }
Exemple #2
0
 public NeoValue Gte(NeoValue other) => NeoBool.ValueOf(Compare(other) <= 0);
Exemple #3
0
 public NeoValue Lte(NeoValue other) => NeoBool.ValueOf(Compare(other) >= 0);