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); } }
public DoomCombatComponent(DoomMapHandler mapHandler, DoomAPIHandler apiHandler, Dictionary <int, GameObject> worldObjects) { this.mapHandler = mapHandler; this.apiHandler = apiHandler; this.worldObjects = worldObjects; }
public DoomMovementComponent(DoomMapHandler mapHandler, DoomAPIHandler apiHandler) { this.mapHandler = mapHandler; this.apiHandler = apiHandler; }