Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
epic-64 committed Oct 18, 2024
1 parent 22617ba commit a31de9a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
3 changes: 0 additions & 3 deletions src/main/scala/ScalaScape/components/GameState.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ class GameState:
var inventory: Map[String, Int] = Map("Wood" -> 0, "Stone" -> 0)
var skills: Map[String, Skill] = Map(
"Woodcutting" -> Woodcutting(),
"Quarrying" -> Quarrying(),
"Woodworking" -> Woodworking(),
"Stonecutting" -> Stonecutting()
)
end GameState
70 changes: 1 addition & 69 deletions src/main/scala/ScalaScape/components/Skills.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ trait Skill:

this
end update

def getAsciiArt(position: Pos): TerminalParagraph = parseArt(position)

protected def parseArt(position: Pos): TerminalParagraph = ???
end Skill

case class Woodcutting() extends Skill {
Expand All @@ -73,68 +69,4 @@ case class Woodcutting() extends Skill {

override def onComplete(state: GameState): Unit =
state.inventory = state.inventory.updated("Wood", state.inventory("Wood") + 1)

override def parseArt(position: Pos): TerminalParagraph = WoodCuttingArtwork(position)
}

case class Quarrying() extends Skill {
val name: String = "Quarrying"
var xp: Int = 0
var level: Int = 1

override def onComplete(state: GameState): Unit =
state.inventory = state.inventory.updated("Stone", state.inventory("Stone") + 1)

override def parseArt(position: Pos): TerminalParagraph = {
val art: String = """
| . . .
| . . * . .
| . . . *
| . ------ . . .
| . /WWWI; \ . .
| /WWWWII; =====; . /WI; \
| /WWWWWII;.. _ . /WI;:. \
| . /WWWWWIIIIi;.. _/WWWIIII:.. _
| /WWWWWIIIi;;;:...: ;\WWWWWWIIIII;
| /WWWWWIWIiii;;;.:.. : ;\WWWWWIII;;;
|""".stripMargin

val colorMap = Map(
'-' -> WHITE_BRIGHT,
'/' -> WHITE_BRIGHT,
'\\' -> WHITE_BRIGHT,
':' -> WHITE_BRIGHT,
'U' -> WHITE_BRIGHT,
'B' -> BLUE_BRIGHT,
'R' -> RED_BRIGHT,
'L' -> YELLOW_BRIGHT
)

val colors: String = """
| . U .
| . R U . .
| . . . L
| B ------ . B .
| . /WWWI; \ . .
| /WWWWII; =====; . /WI; \
| /WWWWWII;.. _ . /WI;:. \
| . /WWWWWIIIIi;.. _/WWWIIII:.. _
| /WWWWWIIIi;;;:...: ;\WWWWWWIIIII;
| /WWWWWIWIiii;;;.:.. : ;\WWWWWIII;;;
|""".stripMargin

TerminalParagraph(TerminalArt.parse(art, colors, Pos(position.x, position.y - 1), colorMap))
}
}

case class Woodworking() extends Skill {
val name: String = "Woodworking"
var xp: Int = 0
var level: Int = 1
}

case class Stonecutting() extends Skill {
val name: String = "Stonecutting"
var xp: Int = 0
var level: Int = 1
}
}

0 comments on commit a31de9a

Please sign in to comment.