public override DreamValue OperatorSubtract(DreamValue a, DreamValue b)
        {
            DreamList list     = a.GetValueAsDreamList();
            DreamList listCopy = list.CreateCopy();

            if (b.Type == DreamValue.DreamValueType.DreamObject)
            {
                if (b.TryGetValueAsDreamList(out DreamList bList))
                {
                    foreach (DreamValue value in bList.GetValues())
                    {
                        listCopy.RemoveValue(value);
                    }
                }
                else
                {
                    listCopy.RemoveValue(b);
                }
            }
            else
            {
                listCopy.RemoveValue(b);
            }

            return(new DreamValue(listCopy));
        }
        public DreamValue OperatorMask(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.TryGetValueAsDreamList(out DreamList bList))
            {
                for (int i = 1; i <= list.GetLength(); i++)
                {
                    if (!bList.ContainsValue(list.GetValue(new DreamValue(i))))
                    {
                        list.Cut(i, i + 1);
                        i--;
                    }
                }
            }
            else
            {
                for (int i = 1; i <= list.GetLength(); i++)
                {
                    if (list.GetValue(new DreamValue(i)) != b)
                    {
                        list.Cut(i, i + 1);
                        i--;
                    }
                }
            }

            return(a);
        }
        public override DreamValue OperatorCombine(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.Type == DreamValue.DreamValueType.DreamObject)
            {
                if (b.TryGetValueAsDreamList(out DreamList bList))
                {
                    foreach (DreamValue value in bList.GetValues())
                    {
                        if (!list.ContainsValue(value))
                        {
                            list.AddValue(value);
                        }
                    }
                }
                else if (!list.ContainsValue(b))
                {
                    list.AddValue(b);
                }
            }
            else if (!list.ContainsValue(b))
            {
                list.AddValue(b);
            }

            return(a);
        }
        public override DreamValue OperatorRemove(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.Type == DreamValue.DreamValueType.DreamObject)
            {
                if (b.TryGetValueAsDreamList(out DreamList bList))
                {
                    foreach (DreamValue value in bList.GetValues())
                    {
                        list.RemoveValue(value);
                    }
                }
                else
                {
                    list.RemoveValue(b);
                }
            }
            else
            {
                list.RemoveValue(b);
            }

            return(a);
        }
        public DreamValue OperatorOr(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.TryGetValueAsDreamList(out DreamList bList))      // List | List
            {
                list = list.Union(bList);
            }
            else                                                    // List | x
            {
                list = list.CreateCopy();
                list.AddValue(b);
            }

            return(new DreamValue(list));
        }
        public DreamValue OperatorAppend(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.TryGetValueAsDreamList(out DreamList bList))
            {
                foreach (DreamValue value in bList.GetValues())
                {
                    list.AddValue(value);
                }
            }
            else
            {
                list.AddValue(b);
            }

            return(a);
        }
        public DreamValue OperatorAdd(DreamValue a, DreamValue b)
        {
            DreamList list     = a.GetValueAsDreamList();
            DreamList listCopy = list.CreateCopy();

            if (b.TryGetValueAsDreamList(out DreamList bList))
            {
                foreach (DreamValue value in bList.GetValues())
                {
                    listCopy.AddValue(value);
                }
            }
            else
            {
                listCopy.AddValue(b);
            }

            return(new DreamValue(listCopy));
        }
        public DreamValue OperatorRemove(DreamValue a, DreamValue b)
        {
            DreamList list = a.GetValueAsDreamList();

            if (b.TryGetValueAsDreamList(out DreamList bList))
            {
                DreamValue[] values = bList.GetValues().ToArray();

                foreach (DreamValue value in values)
                {
                    list.RemoveValue(value);
                }
            }
            else
            {
                list.RemoveValue(b);
            }

            return(a);
        }