Wire up inventory select to ship state

Also mixed into this commit:

* Use returning drivers where possible
* Make the credits screen returnable via click
This commit is contained in:
2020-04-14 15:11:25 +01:00
parent 26c976353f
commit 2f65cd312a
11 changed files with 158 additions and 53 deletions

View File

@@ -1,8 +1,18 @@
package ship
type DifficultyLevel int
const (
DifficultyLevelMarine DifficultyLevel = 0
DifficultyLevelVeteran DifficultyLevel = 1
DifficultyLevelHero DifficultyLevel = 2
DifficultyLevelMighty DifficultyLevel = 3
)
// Ship encapsulates campaign state, including current location in the campaign,
// marines and their stats, supplies, etc.
type Ship struct {
Difficulty DifficultyLevel
NextScenario string
Squads []*Squad
@@ -68,3 +78,16 @@ type Honours struct {
PuritySeal bool
ImperialLaurel bool
}
func New() *Ship {
s := &Ship{}
s.Reset()
return s
}
func (s *Ship) Reset() {
*s = Ship{
Difficulty: DifficultyLevelVeteran, // Default difficulty level
}
}