internal void Update(IObserveAbility observe, Regulus.Project.TurnBasedRPG.Map.EntityInfomation[] entitys, List<IObservedAbility> lefts) { foreach (var exit in lefts) { _Remove(_Within, exit.Id); if (LeftEvent != null) LeftEvent(exit); } foreach(var e in entitys.Except(_Within)) { if (e.Observed != null) { if (IntoEvent != null) IntoEvent(e.Observed); } } foreach (var e in _Within.Except(entitys)) { if (e.Observed != null) { if (LeftEvent != null) LeftEvent(e.Observed); } } _Within = entitys.ToList(); }
private void _UpdateObservers(IObserveAbility observer) { var brounds = observer.Vision; var inbrounds = _ObseverdInfomations.Query(brounds); observer.Update(inbrounds.ToArray(), _Lefts); }
private void _UpdateMovers(IMoverAbility moverAbility, IObserveAbility observeAbility, PhysicalAbility physical) { var w = physical.Bounds.Width; var h = physical.Bounds.Height; var x = observeAbility.Position.X - w / 2; var y = observeAbility.Position.Y - h / 2; var brounds = new Regulus.CustomType.Rect(x, y, w, h); var inbrounds = _ObseverdInfomations.Query(brounds); var obbs = from qtoa in inbrounds let ma = qtoa.Move where ma != null && moverAbility != ma select ma.Polygon; moverAbility.Update(_Time.Ticks, obbs); }