From: Scott Worley Date: Thu, 1 Dec 2011 15:34:51 +0000 (-0800) Subject: Allow specifying a starting cargo X-Git-Url: http://git.scottworley.com/planeteer/commitdiff_plain/a06dc4cbaa5d9172483e91a15bb481f3fdbbbc9e?ds=sidebyside Allow specifying a starting cargo --- diff --git a/planeteer.go b/planeteer.go index 72f9935..a707d58 100644 --- a/planeteer.go +++ b/planeteer.go @@ -43,6 +43,8 @@ var fuel = flag.Int("fuel", 16, "Hyper Jump power left") var hold = flag.Int("hold", 300, "Size of your cargo hold") +var start_hold = flag.String("start_hold", "", "Start with a hold full of cargo") + var start_edens = flag.Int("start_edens", 0, "How many Eden Warp Units are you starting with?") @@ -283,7 +285,9 @@ func CreateStateTable(data planet_data, dims []int) []State { addr[Fuel] = *fuel addr[Edens] = *start_edens addr[Location] = data.p2i[*start] - addr[Traded] = 1 + if *start_hold != "" { + addr[Hold] = data.c2i[*start_hold] + } start_index := EncodeIndex(dims, addr) table[start_index].value = int32(*funds) table[start_index].from = FROM_ROOT