speck-path is now a command-line option

slack
Jordan Orelli 10 years ago
parent 4158537894
commit 060609470a

@ -39,7 +39,7 @@ func planetsData() {
return return
} }
if n == 0 { if n == 0 {
fi, err := os.Open(dataPath) fi, err := os.Open(options.speckPath)
if err != nil { if err != nil {
bail(E_No_Data, "unable to open data path: %v", err) bail(E_No_Data, "unable to open data path: %v", err)
} }

@ -21,10 +21,10 @@ var options struct {
bombSpeed float64 bombSpeed float64
economic int economic int
debug bool debug bool
speckPath string
} }
var ( var (
dataPath = "/projects/exo/expl.speck"
info_log *log.Logger info_log *log.Logger
error_log *log.Logger error_log *log.Logger
currentGame *Game currentGame *Game
@ -130,4 +130,5 @@ func init() {
flag.Float64Var(&options.moneyMean, "money-mean", 10000, "mean amount of money on a system") flag.Float64Var(&options.moneyMean, "money-mean", 10000, "mean amount of money on a system")
flag.Float64Var(&options.moneySigma, "money-sigma", 1500, "standard deviation in money per system") flag.Float64Var(&options.moneySigma, "money-sigma", 1500, "standard deviation in money per system")
flag.BoolVar(&options.debug, "debug", false, "puts the game in debug mode") flag.BoolVar(&options.debug, "debug", false, "puts the game in debug mode")
flag.StringVar(&options.speckPath, "speck-path", "/projects/exo/expl.speck", "path to exoplanet speck file")
} }

Loading…
Cancel
Save