public LocRay4(int x, int y, Dir4 dir) { this.Loc = new Loc(x, y); this.Dir = dir; }
public LocRay4(Dir4 dir) { this.Loc = Loc.Zero; this.Dir = dir; }
public LocRay4(Loc loc, Dir4 dir) { this.Loc = loc; this.Dir = dir; }
public LocRay8(Loc loc, Dir8 dir) { this.Loc = loc; this.Dir = dir; }
public LocRay4(Loc loc) { this.Loc = loc; this.Dir = Dir4.None; }
public LocRay8(Dir8 dir) { this.Loc = Loc.Zero; this.Dir = dir; }
public LocRay8(Loc loc) { this.Loc = loc; this.Dir = Dir8.None; }
public void InitSize(Loc size) { this.Size = size; this.Rooms = new List <FloorRoomPlan>(); this.Halls = new List <FloorHallPlan>(); }
public YieldInstruction _MoveToLoc(GroundEntity ent, RogueElements.Loc pos, bool run = false) { return(_MoveToPosition(ent, pos.X, pos.Y, run)); }
public override void ApplyToPath(IRandom rand, GridPlan floorPlan) { for (int ii = 0; ii < 10; ii++) { // always clear before trying floorPlan.Clear(); int roomsToOpen = floorPlan.GridWidth * floorPlan.GridHeight * this.RoomRatio.Pick(rand) / 100; if (roomsToOpen < 1) { roomsToOpen = 1; } int addBranch = this.BranchRatio.Pick(rand); int roomsLeft = roomsToOpen; Loc sourceRoom = new Loc(rand.Next(floorPlan.GridWidth), rand.Next(floorPlan.GridHeight)); // randomly determine start room floorPlan.AddRoom(sourceRoom, this.GenericRooms.Pick(rand), this.RoomComponents.Clone()); GenContextDebug.DebugProgress("Start Room"); roomsLeft--; int pendingBranch = 0; while (roomsLeft > 0) { bool terminalSuccess = this.ExpandPath(rand, floorPlan, false); bool branchSuccess = false; if (terminalSuccess) { roomsLeft--; if (floorPlan.RoomCount > 2) { pendingBranch += addBranch; } } else if (this.NoForcedBranches) { break; } else { pendingBranch = 100; } while (pendingBranch >= 100 && roomsLeft > 0) { branchSuccess = this.ExpandPath(rand, floorPlan, true); if (!branchSuccess) { break; } pendingBranch -= 100; roomsLeft--; } if (!terminalSuccess && !branchSuccess) { break; } } if (roomsLeft <= 0) { break; } } }