refactor into smaller units

This commit is contained in:
Rory Hinnen
2026-09-12 11:25:34 -05:00
parent 4eb7494d08
commit 1507f8b8c6
14 changed files with 637 additions and 415 deletions
@@ -0,0 +1,49 @@
//
// InfoAreaView.swift
// Bunch O' Dice
//
import SwiftUI
struct InfoAreaView: View {
@EnvironmentObject var current: Roll
var body: some View {
VStack(alignment: .leading, spacing: 6) {
switch current.state {
case .hit:
if current.lethalHits || current.sustainedHits {
Text("Crits (6s): \(current.critHitCount)")
.fontWeight(.semibold)
.foregroundColor(.orange)
}
if current.antiX {
Text("Anti-X (\(current.antiXThreshold)+): \(current.antiXCount)")
.fontWeight(.semibold)
.foregroundColor(.orange)
}
case .wound:
if current.autoWoundsCarried > 0 {
Text("Auto-wounds carried: \(current.autoWoundsCarried) (skip wound roll)")
.fontWeight(.semibold)
.foregroundColor(.orange)
}
if current.devastatingWounds {
Text("Mortals (6s): \(current.critWoundCount)")
.fontWeight(.semibold)
.foregroundColor(.orange)
}
case .armour:
EmptyView()
}
}
.font(.system(size: 18))
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
}
}
#Preview {
InfoAreaView()
.environmentObject(Roll())
}