Ejemplo n.º 1
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map = world.Map;
            influence = new InfluenceNode[world.Map.MapSize.X, world.Map.MapSize.Y];

            cols = world.Map.MapSize.X / info.BinSize + 1;
            rows = world.Map.MapSize.Y / info.BinSize + 1;
            actors = new List<Actor>[rows * cols];
            for (var j = 0; j < rows; j++)
                for (var i = 0; i < cols; i++)
                    actors[j * cols + i] = new List<Actor>();
        }
Ejemplo n.º 2
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map = world.Map;
            influence = new CellLayer<InfluenceNode>(world.Map);

            cols = world.Map.MapSize.X / info.BinSize + 1;
            rows = world.Map.MapSize.Y / info.BinSize + 1;
            bins = new Bin[rows * cols];
            for (var j = 0; j < rows; j++)
                for (var i = 0; i < cols; i++)
                    bins[j * cols + i] = new Bin();

            // Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }
Ejemplo n.º 3
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map = world.Map;
            influence = new CellLayer<InfluenceNode>(world.Map);

            cols = CellCoordToBinIndex(world.Map.MapSize.X) + 1;
            rows = CellCoordToBinIndex(world.Map.MapSize.Y) + 1;
            bins = new Bin[rows * cols];
            for (var row = 0; row < rows; row++)
                for (var col = 0; col < cols; col++)
                    bins[row * cols + col] = new Bin();

            // Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }
Ejemplo n.º 4
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map       = world.Map;
            influence = new InfluenceNode[world.Map.MapSize.X, world.Map.MapSize.Y];

            cols   = world.Map.MapSize.X / info.BinSize + 1;
            rows   = world.Map.MapSize.Y / info.BinSize + 1;
            actors = new List <Actor> [rows * cols];
            for (var j = 0; j < rows; j++)
            {
                for (var i = 0; i < cols; i++)
                {
                    actors[j * cols + i] = new List <Actor>();
                }
            }
        }
Ejemplo n.º 5
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map       = world.Map;
            influence = new CellLayer <InfluenceNode>(world.Map);

            cols = CellCoordToBinIndex(world.Map.MapSize.X) + 1;
            rows = CellCoordToBinIndex(world.Map.MapSize.Y) + 1;
            bins = new Bin[rows * cols];
            for (var row = 0; row < rows; row++)
            {
                for (var col = 0; col < cols; col++)
                {
                    bins[row * cols + col] = new Bin();
                }
            }

            // PERF: Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }
Ejemplo n.º 6
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map       = world.Map;
            influence = new CellLayer <InfluenceNode>(world.Map);

            cols = world.Map.MapSize.X / info.BinSize + 1;
            rows = world.Map.MapSize.Y / info.BinSize + 1;
            bins = new Bin[rows * cols];
            for (var j = 0; j < rows; j++)
            {
                for (var i = 0; i < cols; i++)
                {
                    bins[j * cols + i] = new Bin();
                }
            }

            // Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }