include diehammer plan docs
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Die.swift
|
||||
// Bunch O' Dice
|
||||
//
|
||||
// Created by Rory Hinnen on 22/6/18.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct Die: View {
|
||||
@EnvironmentObject var current: Roll
|
||||
|
||||
@State var whichDie: Dice.DiceType
|
||||
|
||||
var body: some View {
|
||||
/* let size = 25.0
|
||||
let displayColorHit = (whichDie.rawValue >= current.cutoff.rawValue) ? Color.red : Color.primary
|
||||
let displayColorArmor = (whichDie.rawValue <= current.cutoff.rawValue) ? Color.red : Color.primary
|
||||
let displayColorArmorText = (whichDie.rawValue < current.cutoff.rawValue) ? Color.red : Color.primary
|
||||
|
||||
HStack{
|
||||
Text(String(current.dice.value(which: whichDie)))
|
||||
.foregroundColor(current.state == .armour ?
|
||||
displayColorArmorText : displayColorHit)
|
||||
Image(systemName: "die.face." + String(whichDie.rawValue) + ".fill")
|
||||
.foregroundColor(current.state == .armour ?
|
||||
displayColorArmor : displayColorHit)
|
||||
|
||||
}
|
||||
.font(.system(size: size))
|
||||
.padding(2)
|
||||
.gesture(TapGesture().onEnded {
|
||||
if current.state == .hit {
|
||||
if whichDie.rawValue != 1 {
|
||||
current.hitCutoff = whichDie }
|
||||
} else if current.state == .armour {
|
||||
current.armourSave = Int(whichDie.rawValue)
|
||||
}
|
||||
})
|
||||
} */
|
||||
Text("")
|
||||
}
|
||||
|
||||
struct Die_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Die(whichDie: Dice.DiceType.one)
|
||||
.environmentObject(Roll())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user