feat(io): welcome banner for game start
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package thb.jeanluc.adventure.io.text;
|
||||
|
||||
/** Builds styled banners for big moments (game start, finale). */
|
||||
public final class Banner {
|
||||
|
||||
private Banner() {
|
||||
}
|
||||
|
||||
/** A framed, heading-styled welcome banner for the given title. */
|
||||
public static StyledText welcome(String title) {
|
||||
String bar = "=".repeat(Math.max(8, title.length() + 8));
|
||||
return StyledText.builder()
|
||||
.heading(bar + "\n")
|
||||
.heading(" " + title + "\n")
|
||||
.heading(bar)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user