Esempio n. 1
0
        public DoomFloodFill(DoomMapHandler mapHandler, List <DoomLine> levelLines, Vector3 startPoint, DoomWad.Vertexes vertexes, float scale, float xOffset, float zOffset)
        {
            positions         = new List <NavigationNode>();
            levelLineGeometry = levelLines;
            this.mapHandler   = mapHandler;


            float startX = vertexes.Entries.Min(x => x.X - 10) / scale + xOffset;
            float startZ = vertexes.Entries.Min(x => x.Y - 10) / scale + zOffset;

            float maxX = vertexes.Entries.Max(x => x.X - 10) / scale + xOffset;
            float maxZ = vertexes.Entries.Max(x => x.Y - 10) / scale + zOffset;

            float width  = maxX - startX;
            float height = maxZ - startZ;

            int bucketSize    = 5;
            int numofBucketsX = (int)width / bucketSize + 2;
            int numofBucketsZ = (int)height / bucketSize + 2;

            partition = new BucketPartition(startX - 1, startZ - 1, bucketSize, numofBucketsX, numofBucketsZ);

            NavigationNode p = new NavigationNode()
            {
                WorldPosition = startPoint
            };

            p.Navigable = true;
            positions.Add(p);
            positionsToSearch.Enqueue(p);

            partition.AddNavigationNode(p);

            foreach (DoomLine l in levelLines)
            {
                partition.AddDoomLine(l);
            }
        }
Esempio n. 2
0
 public DoomCombatComponent(DoomMapHandler mapHandler, DoomAPIHandler apiHandler, Dictionary <int, GameObject> worldObjects)
 {
     this.mapHandler   = mapHandler;
     this.apiHandler   = apiHandler;
     this.worldObjects = worldObjects;
 }
Esempio n. 3
0
 public DoomMovementComponent(DoomMapHandler mapHandler, DoomAPIHandler apiHandler)
 {
     this.mapHandler = mapHandler;
     this.apiHandler = apiHandler;
 }