예제 #1
0
 public void Dispose()
 {
     if (layerPool != null)
     {
         foreach (var layer in layers)
         {
             layerPool.ReturnLayer(layer);
         }
     }
     layers    = null;
     layerPool = null;
 }
예제 #2
0
        public PathGraph(CellInfoLayerPool layerPool, MobileInfo mobileInfo, Actor actor, World world, bool checkForBlocked)
        {
            pooledLayer = layerPool.Get();
            groundInfo  = pooledLayer.GetLayer();

            var layers = world.GetCustomMovementLayers().Values.Where(cml => cml.EnabledForActor(actor.Info, mobileInfo));

            foreach (var cml in layers)
            {
                customLayerInfo[cml.Index] = Pair.New(cml, pooledLayer.GetLayer());
            }

            World              = world;
            this.mobileInfo    = mobileInfo;
            worldMovementInfo  = mobileInfo.GetWorldMovementInfo(world);
            Actor              = actor;
            LaneBias           = 1;
            checkConditions    = checkForBlocked ? CellConditions.TransientActors:CellConditions.None;
            checkTerrainHeight = world.Map.Grid.MaximumTerrainHeight > 0;
        }
예제 #3
0
 public PooledCellInfoLayer(CellInfoLayerPool layerPool)
 {
     this.layerPool = layerPool;
 }