programaker / Joguin2

Toy Scala project to study some cool Functional Programming concepts (version 1 was in Java)
2 stars 0 forks source link

Type-safe Invasion status #27

Open programaker opened 4 years ago

programaker commented 4 years ago

Draft of the idea - https://scastie.scala-lang.org/programaker/QzbOoPCxTIuCvlXhWyUPBA/8

GameProgress.start should accept only defeated Invasions. defeated flag will be removed and replaced by type checking.

programaker commented 4 years ago

To make it really safe, GameProgress changes proposed in #4 are necessary, otherwise we can't handle Invasions with different statuses inside the same GameProgress. We'll need a Start game progress with only Active Invasions and a InBattle progress with mixed