-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
85 lines (75 loc) · 2.15 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package main
import (
"fmt"
"github.com/dreznel/lastlands/v2/internal/character"
"github.com/dreznel/lastlands/v2/internal/display"
"github.com/AlecAivazis/survey/v2"
)
// the questions to ask
// var qs = []*survey.Question{
// {
// Name: "name",
// Prompt: &survey.Input{Message: "What is your name?"},
// Validate: survey.Required,
// Transform: survey.Title,
// },
// {
// Name: "color",
// Prompt: &survey.Select{
// Message: "Choose a color:",
// Options: []string{"red", "blue", "green"},
// Default: "red",
// },
// },
// {
// Name: "age",
// Prompt: &survey.Input{Message: "How old are you?"},
// },
// }
func main() {
for {
mainMenuSelection := ""
prompt := &survey.Select{
Message: "Welcome to the Lastlands Character Mangaer! Select an option:",
Options: []string{"Create Character", "Manager Character"},
}
err := survey.AskOne(prompt, &mainMenuSelection)
if err != nil {
fmt.Println(err.Error())
return
}
switch mainMenuSelection {
case "Create Character":
fmt.Println("Creating character...")
createCharacterInterface()
break
case "Manage Character":
fmt.Println("Sorry! The Manage Character feature isn't implemented yet!")
break
default:
break
}
}
// // the answers will be written to this struct
// answers := struct {
// Name string // survey will match the question and field names
// FavoriteColor string `survey:"color"` // or you can tag fields to match a specific name
// Age int // if the types don't match, survey will convert it
// }{}
// // perform the questions
// err := survey.Ask(qs, &answers)
// if err != nil {
// fmt.Println(err.Error())
// return
// }
//fmt.Printf("%s chose %s.", answers.Name, answers.FavoriteColor)
}
func createCharacterInterface() {
seeker := character.CreateCharacter()
fmt.Println(fmt.Sprintf("They call me %s, here", seeker.Name))
fmt.Println("----")
fmt.Println(fmt.Sprintf("Core Memories: %v", seeker.CoreAttributes))
display.GetCharacterSheetTables(seeker).Print()
//display.BasicStatTable(seeker).Print()
//fmt.Println(fmt.Sprintf("Base stats:\n %v", seeker.AbilityScores))
}