Skip to content

Commit

Permalink
Merge pull request #1 from Vyxal/vyncode-version-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lyxal authored May 23, 2023
2 parents e4315da + e3367e7 commit 2816cc7
Show file tree
Hide file tree
Showing 4 changed files with 1,531 additions and 16 deletions.
11 changes: 6 additions & 5 deletions js/src/main/scala/JSVycoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ given Conversion[Int, BigDecimal] with
@JSExportTopLevel("Vyncode")
object JSVyncode:

var version: Int = 1
val versions: Seq[Int] = Seq(1)
var version: Int = 2
val versions: Seq[Int] = Seq(1, 2)
var predictionObj: Predictions = Predictions()
var initalised: Boolean = false

@JSExport
def setVersion(ver: Int): Unit =
if !versions.contains(ver) then throw new Exception("Invalid version")
version = ver
predictionObj.initalise(ver)
if ver == -1 then version = versions.max
else if !versions.contains(ver) then throw new Exception("Invalid version")
else version = ver
predictionObj.initalise(version)
initalised = true

@JSExport
Expand Down
4 changes: 2 additions & 2 deletions jvm/src/main/scala/CLI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object CLI:
case Encode, Decode
case class CLIConfig(
method: Method = Method.Encode,
version: Int = 1,
version: Int = 2,
input: Option[String] = None
)

Expand All @@ -14,7 +14,7 @@ object CLI:
import builder.*
OParser.sequence(
programName("Vyncoder"),
head("Vyncoder", "1.0"),
head("Vyncoder", "2.0"),
opt[Unit]('h', "help")
.action((_, cfg) =>
println("Vyncoder - A Vyxal encoder/decoder")
Expand Down
Loading

0 comments on commit 2816cc7

Please sign in to comment.