public AbstractHookState(hook pHook) { if (!_hook) { _hook = pHook; } }
public void RemoveListener(hook src) { if (null != notify && notify.Remove(src) && 0 >= notify.Count) { notify = null; } }
public IActionResult Create(hook hook, string returnUrl = null) { if (ModelState.IsValid) { repository.AddEntity(hook); return(RedirectToLocal(returnUrl)); } ViewData["ReturnUrl"] = returnUrl; return(View(hook)); }
/// <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 } }
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)); }
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; } }
public FollowBoatHookState(hook pHook, boat pBoat) : base(pHook) { _boat = pBoat; }
public ReelHookState(hook pHook, boat pBoat, float pReelSpeed) : base(pHook) { _boat = pBoat; _reelSpeed = pReelSpeed; }
public NoneHookState(hook pHook) : base(pHook) { }
private void isclick(object sender, RoutedEventArgs e) { hook hookcs = new hook(); hookcs.Start(); }
public FishHookState(hook pHook, float pSideSpeed, float pDownSpeed, float pFallSpeed) : base(pHook) { _sideSpeed = pSideSpeed; _downSpeed = pDownSpeed; _fallSpeed = pFallSpeed; }
public SetFreeHookState(hook pHook) : base(pHook) { }
private void SpawnHook() { Hook = Instantiate(_hookPrefab, Boat.transform.position, Quaternion.identity).GetComponent <hook>(); }
public void AddListener(hook src) { (notify ??= new()).Add(src); }