コード例 #1
0
 public Sight2D(IObserver observer, SightConfiguration config, ISightCache cache, ISightRaycaster raycaster, ISightPathExtrapolator extrapolator)
     : base(observer, config, cache, raycaster, extrapolator)
 {
 }
コード例 #2
0
        public Sight(IObserver observer, SightConfiguration config, ISightCache cache, ISightRaycaster raycaster, ISightPathExtrapolator extrapolator)
        {
            Assert.IsNotNull(observer);
            Assert.IsNotNull(config);
//            Assert.IsNotNull(cache); // Cache can be null IF all targets use manual indexing.
            Assert.IsNotNull(raycaster);
            if (config.extrapolatePath)
            {
                Assert.IsNotNull(extrapolator, "Use extrapolate path is enabled, but no ISightPathExtrapolator implementation given.");
            }

            this.observer     = observer;
            this.config       = config;
            this.cache        = cache;
            this.raycaster    = raycaster;
            this.extrapolator = extrapolator;

            targetsInRange = new List <SightTargetInfo>(16);
        }