public void Watch(EntryType entryType, string path = null) { var target = new WatchTarget(entryType, path ?? WorkingDirectory); Watcher.Watch(target); Log.Debug($"watcher watch {target}"); }
public void Watch(EntryType entryType, string path = null) { var target = new WatchTarget(entryType, path ?? WorkingDirectory); Mirror.Watch(target); Mirror.RunAsync(); Log.Debug($"mirror watch {target}"); }
public IWatchTarget Watch <T>(Monitor <T> monitor, Handler <T> onChange) //adds a monitor to the list of observees { WatchTarget <T> observee = new WatchTarget <T>() { State = monitor(), Eval = monitor, Handler = onChange }; _targets.Add(observee); return(observee); }
/// <summary> /// Executed in every update if State is Chasing /// </summary> protected virtual void UpdateChasing() { if (WatchTarget == null) { return; } if (WatchTargetDistance < AttackDistance) { State = NpcState.Attack; } if ((lastUpdateTime + updateInterval) > Time.time) { return; } if (targetAtUpdate == null || WatchTarget.DistanceTo(targetAtUpdate.Value) < updateDistance) //did our target move enough { return; } MoveToTarget(WatchTarget.position); }
public void Watch(WatchTarget target) => _mirror.Watch(target);