Skip to content
Permalink
Browse files

Conditional Top Boundary Sides

  • Loading branch information...
liamrosenfeld committed Apr 20, 2019
1 parent 783eb5f commit f20f9fca9c5cc255e288a05f55ec64cb952702e3
@@ -12,4 +12,5 @@ public struct Bubble {
var left: Character
var right: Character
public var line: String
var topSides: Bool
}
@@ -12,6 +12,7 @@ internal class BubbleBuilder {
let btmChar: Character
let leftChar: Character
let rightChar: Character
let topSides: Bool

// Bubble Dimensions
let maxSignWidth = 32
@@ -47,7 +48,12 @@ internal class BubbleBuilder {

func buildSignBoundary(length: Int, char: Character) -> String {
let dashes = String(repeating: char, count: length)
return "\(leftChar)\(dashes)\(rightChar)"
if topSides {
return "\(leftChar)\(dashes)\(rightChar)"
} else {
return " \(dashes) "
}

}

// Line Splitting
@@ -100,5 +106,6 @@ internal class BubbleBuilder {
self.btmChar = style.btm
self.leftChar = style.left
self.rightChar = style.right
self.topSides = style.topSides
}
}
@@ -12,21 +12,24 @@ public let bubbles = [
btm: "~",
left: "(",
right: ")",
line: "0"
line: "0",
topSides: false
),
"yell": Bubble(
top: "",
btm: "",
left: "<",
right: ">",
line: "X"
line: "X",
topSides: false
),
"sign": Bubble(
top: "-",
btm: "-",
left: "|",
right: "|",
line: ""
line: "",
topSides: true
),
]

@@ -35,5 +38,6 @@ public let say = Bubble(
btm: "-",
left: "|",
right: "|",
line: "\\"
line: "\\",
topSides: true
)

0 comments on commit f20f9fc

Please sign in to comment.
You can’t perform that action at this time.