Пример #1
0
        public override Token Extend(Token input)
        {
            var args = Extend();

            if (args == null || args.ElementAtOrDefault(0) == null)
            {
                Compiler.ExceptionListener.Throw($"{this.Name} arguments cannot be null.",
                                                 ExceptionType.CompilerException, input.Line);
            }
            int index  = 0;
            var nofail = int.TryParse(args[0].ToString(), out index);

            if (!nofail)
            {
                Compiler.ExceptionListener.Throw($"{this.Name} arguments must be a whole number.",
                                                 ExceptionType.CompilerException, input.Line);
            }

            if (input == null || input.Value == null)
            {
                Compiler.ExceptionListener.Throw($"Extension cannot extend null.");
            }
            var inputAsTobj = new TArray("arr", input.Value, input.Line);

            inputAsTobj.Remove(index);
            return(inputAsTobj);
        }
Пример #2
0
 public virtual void RemoveUnLoad(Updateable u)
 {
     lock (unloads)
     {
         unloads.Remove(u);
     }
 }
Пример #3
0
 public virtual void RemoveLoad(Updateable u)
 {
     lock (loads)
     {
         loads.Remove(u);
     }
 }
Пример #4
0
 public virtual void RemoveResume(Updateable u)
 {
     lock (resumes)
     {
         resumes.Remove(u);
     }
 }
Пример #5
0
        public TArray <Triangle2f> CreateTriangulates()
        {
            TArray <Triangle2f> triangles = new TArray <Triangle2f>();

            if (points.Size() <= 3)
            {
                return(triangles);
            }

            int index = 1;

            for (; points.Size() > 3;)
            {
                if (IsEar(points.Get(GetIndex(index, -1)), points.Get(index), points.Get(GetIndex(index, 1))))
                {
                    triangles.Add(new Triangle2f(points.Get(GetIndex(index, -1)), points.Get(index),
                                                 points.Get(GetIndex(index, 1))));
                    points.Remove(points.Get(index));
                    index = GetIndex(index, -1);
                }
                else
                {
                    index = GetIndex(index, 1);
                }
            }

            triangles.Add(new Triangle2f(points.Get(0), points.Get(1), points.Get(2)));

            return(triangles);
        }
Пример #6
0
 public void Remove(Callback <T> callback)
 {
     CheckState();
     callbacks.Remove(callback);
 }
Пример #7
0
 public virtual bool Remove(Interval sched)
 {
     return(_scheduled.Remove(sched));
 }