Dungeon Browser
This commit is contained in:
@@ -11,4 +11,45 @@ public class DungeonInstance
|
||||
public DungeonSimulation Simulation { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public bool ClearedHandled { get; set; } = false;
|
||||
|
||||
// Level bracket system
|
||||
public int LevelBracketMin { get; set; }
|
||||
public int LevelBracketMax { get; set; }
|
||||
public int CreatorLevel { get; set; }
|
||||
public ulong CreatorCharacterId { get; set; }
|
||||
public string CreatorName { get; set; } = "";
|
||||
|
||||
// Auto-join window (5 minutes)
|
||||
public DateTime JoinWindowEnd => CreatedAt.AddMinutes(5);
|
||||
public bool IsJoinWindowOpen => DateTime.UtcNow < JoinWindowEnd;
|
||||
|
||||
// Persistence
|
||||
public DateTime LastPlayerActivity { get; set; } = DateTime.UtcNow;
|
||||
public bool IsPersisted { get; set; } = false;
|
||||
public bool BossKilled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Check if a player level is within the bracket range
|
||||
/// </summary>
|
||||
public bool IsLevelInBracket(int playerLevel)
|
||||
{
|
||||
return playerLevel >= LevelBracketMin && playerLevel <= LevelBracketMax;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate level bracket from a player's level (brackets of 10: 1-10, 11-20, 21-30, etc.)
|
||||
/// </summary>
|
||||
public static (int min, int max) GetLevelBracket(int level)
|
||||
{
|
||||
// Bracket 1: 1-10, Bracket 2: 11-20, etc.
|
||||
int bracketIndex = (level - 1) / 10;
|
||||
int min = bracketIndex * 10 + 1;
|
||||
int max = min + 9;
|
||||
return (min, max);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the bracket number (1, 2, 3, etc.)
|
||||
/// </summary>
|
||||
public int BracketNumber => (LevelBracketMin - 1) / 10 + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user