public static DungeonFlowNode GenerateFlowNode(DungeonFlow flow, PrototypeDungeonRoom.RoomCategory category, PrototypeDungeonRoom overrideRoom = null, GenericRoomTable overrideRoomTable = null, bool loopTargetIsOneWay = false, bool isWarpWing = false, bool handlesOwnWarping = true, float weight = 1f, DungeonFlowNode.NodePriority priority = DungeonFlowNode.NodePriority.MANDATORY, string guid = "") { if (string.IsNullOrEmpty(guid)) { guid = Guid.NewGuid().ToString(); } DungeonFlowNode node = new DungeonFlowNode(flow) { isSubchainStandin = false, nodeType = DungeonFlowNode.ControlNodeType.ROOM, roomCategory = category, percentChance = weight, priority = priority, overrideExactRoom = overrideRoom, overrideRoomTable = overrideRoomTable, capSubchain = false, subchainIdentifier = string.Empty, limitedCopiesOfSubchain = false, maxCopiesOfSubchain = 1, subchainIdentifiers = new List <string>(0), receivesCaps = false, isWarpWingEntrance = isWarpWing, handlesOwnWarping = handlesOwnWarping, forcedDoorType = DungeonFlowNode.ForcedDoorType.NONE, loopForcedDoorType = DungeonFlowNode.ForcedDoorType.NONE, nodeExpands = false, initialChainPrototype = "n", chainRules = new List <ChainRule>(0), minChainLength = 3, maxChainLength = 8, minChildrenToBuild = 1, maxChildrenToBuild = 1, canBuildDuplicateChildren = false, guidAsString = guid, parentNodeGuid = string.Empty, childNodeGuids = new List <string>(0), loopTargetNodeGuid = string.Empty, loopTargetIsOneWay = loopTargetIsOneWay, flow = flow }; return(node); }
// Generate a DungeonFlowNode with a default configuration public static DungeonFlowNode GenerateDefaultNode(DungeonFlow targetflow, PrototypeDungeonRoom.RoomCategory roomType, PrototypeDungeonRoom overrideRoom = null, GenericRoomTable overrideTable = null, bool oneWayLoopTarget = false, bool isWarpWingNode = false, string nodeGUID = null, DungeonFlowNode.NodePriority priority = DungeonFlowNode.NodePriority.MANDATORY, float percentChance = 1, bool handlesOwnWarping = true) { try { if (string.IsNullOrEmpty(nodeGUID)) { nodeGUID = Guid.NewGuid().ToString(); } DungeonFlowNode m_CachedNode = new DungeonFlowNode(targetflow) { isSubchainStandin = false, nodeType = DungeonFlowNode.ControlNodeType.ROOM, roomCategory = roomType, percentChance = percentChance, priority = priority, overrideExactRoom = overrideRoom, overrideRoomTable = overrideTable, capSubchain = false, subchainIdentifier = string.Empty, limitedCopiesOfSubchain = false, maxCopiesOfSubchain = 1, subchainIdentifiers = new List <string>(0), receivesCaps = false, isWarpWingEntrance = isWarpWingNode, handlesOwnWarping = handlesOwnWarping, forcedDoorType = DungeonFlowNode.ForcedDoorType.NONE, loopForcedDoorType = DungeonFlowNode.ForcedDoorType.NONE, nodeExpands = false, initialChainPrototype = "n", chainRules = new List <ChainRule>(0), minChainLength = 3, maxChainLength = 8, minChildrenToBuild = 1, maxChildrenToBuild = 1, canBuildDuplicateChildren = false, guidAsString = nodeGUID, parentNodeGuid = string.Empty, childNodeGuids = new List <string>(0), loopTargetNodeGuid = string.Empty, loopTargetIsOneWay = oneWayLoopTarget, flow = targetflow }; return(m_CachedNode); } catch (Exception e) { ETGModConsole.Log(e.ToString()); return(null); } }