private LOSResult GetLineOfSight(ref ExpiringLosHolder losHolder, bool ballistic) { var h = losHolder; if (h != null && h.Expired) { losHolder = null; Logger.DebugWarning("LOS expired"); } var holder = LazyInitializer.EnsureInitialized(ref losHolder, () => { var losResult = _source.Zone.IsInLineOfSight(_source, Target, ballistic); return(new ExpiringLosHolder(losResult, TimeSpan.FromSeconds(4))); }); return(holder.losResult); }
public void ResetLineOfSight() { _linearLos = null; _ballisticLos = null; }