コード例 #1
0
 public AbstractHookState(hook pHook)
 {
     if (!_hook)
     {
         _hook = pHook;
     }
 }
コード例 #2
0
 public void RemoveListener(hook src)
 {
     if (null != notify && notify.Remove(src) && 0 >= notify.Count)
     {
         notify = null;
     }
 }
コード例 #3
0
 public IActionResult Create(hook hook, string returnUrl = null)
 {
     if (ModelState.IsValid)
     {
         repository.AddEntity(hook);
         return(RedirectToLocal(returnUrl));
     }
     ViewData["ReturnUrl"] = returnUrl;
     return(View(hook));
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: RonNewcomb/pieces
    /// <summary>Re-entrant. An object will soon be deconstructed by tossing it in here.</summary>
    public static void Add(object garbage)
    {
        var h = new hook {
            destroyMe = garbage, age = cycle
        };

        lock (semaphore)
        {
            // insert the new hook into the clothesline CLL by...the new hook points to whatever the GC's hook points to
            h.next = Garbage.myOwnHook.next;
            Garbage.myOwnHook.next = h;              // then the GC's hook points to the new object
        }
    }
コード例 #5
0
        public IActionResult Edit(int id, hook hook, string returnUrl = null)
        {
            if (id != hook.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                this.repository.UpdateEntity(hook);
                return(RedirectToLocal(returnUrl));
            }
            ViewData["ReturnUrl"] = returnUrl;
            return(View(hook));
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: RonNewcomb/pieces
    public static void Collect()
    {
        if (Garbage.clothesline != null)
        {
            return;                                      // there's only one GC, which never ends
        }
        Garbage.clothesline = Garbage.myOwnHook;         // can't use static initializer cause of ordering issues
        hook previous = myOwnHook;

        for (hook current = myOwnHook; ProgramStillRunning || myOwnHook.next != myOwnHook; previous = current, current = current.next)
        {
            if (previous == myOwnHook || current == myOwnHook)
            {   // never operate on the myownhook--myownhook.next border, because that's where new items are added async-ly
                cycle++;
                continue;
            }
            if (current.destroyMe != null)
            {
                // call the dying object's destructor. If it doesn't want to be destroyed, (and it's young), skip it for now.
                if (!current.destroyMe.apoptosis())
                {
                    if (cycle - current.age < 20)
                    {
                        continue;
                    }
                }
                // loop through all ref values held by the class and move them to the clothesline
                foreach (var property in current.destroyMe.allRefProperties())
                {
                    Garbage.Add(current.destroyMe.ValueOfProperty(property));
                    //current.destroyMe.property = null;
                }
                // now remove this class from its hook
                memory.dealloc(current.destroyMe);
                current.destroyMe = null;
            }
            // now that the object is gone, remove its hook from the clothesline
            lock (semaphore)
                previous.next = current.next;
            current.next = null;
            // and destroy the hook itself
            memory.dealloc(current);
            // Set Current back to something on the clothesline.
            current = previous;
        }
    }
コード例 #7
0
 public FollowBoatHookState(hook pHook, boat pBoat) : base(pHook)
 {
     _boat = pBoat;
 }
コード例 #8
0
 public ReelHookState(hook pHook, boat pBoat, float pReelSpeed) : base(pHook)
 {
     _boat      = pBoat;
     _reelSpeed = pReelSpeed;
 }
コード例 #9
0
 public NoneHookState(hook pHook) : base(pHook)
 {
 }
コード例 #10
0
        private void isclick(object sender, RoutedEventArgs e)
        {
            hook hookcs = new hook();

            hookcs.Start();
        }
コード例 #11
0
 public FishHookState(hook pHook, float pSideSpeed, float pDownSpeed, float pFallSpeed) : base(pHook)
 {
     _sideSpeed = pSideSpeed;
     _downSpeed = pDownSpeed;
     _fallSpeed = pFallSpeed;
 }
コード例 #12
0
 public SetFreeHookState(hook pHook) : base(pHook)
 {
 }
コード例 #13
0
ファイル: basic.cs プロジェクト: VoidjumperZA/FinalProject
 private void SpawnHook()
 {
     Hook = Instantiate(_hookPrefab, Boat.transform.position, Quaternion.identity).GetComponent <hook>();
 }
コード例 #14
0
 public void AddListener(hook src)
 {
     (notify ??= new()).Add(src);
 }