Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions variants/beta/southofsahara/bindata.go

Large diffs are not rendered by default.

294 changes: 294 additions & 0 deletions variants/beta/southofsahara/southofsahara.go

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions variants/beta/southofsahara/southofsahara_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package southofsahara

import (
"testing"
"time"

"github.com/zond/godip"
"github.com/zond/godip/orders"
"github.com/zond/godip/state"

tst "github.com/zond/godip/variants/testing"
)

func init() {
godip.Debug = true
}

func startState(t *testing.T) *state.State {
judge, err := SouthofSaharaStart()
if err != nil {
t.Fatalf("%v", err)
}
return judge
}

func TestSouthofSaharaBuildAnywhere(t *testing.T) {
judge := startState(t)

// Give Benin an extra SC in Kongo.
judge.SetSC("kon", Benin)

// Spring movement
judge.SetOrder("ife", orders.Move("ife", "oyo"))
judge.Next()
// Spring retreat
judge.Next()
// Fall movement
judge.SetOrder("edo", orders.Move("edo", "ije"))
judge.Next()
// Fall retreat
judge.Next()

// Fall adjustment - Try to build a new Army in Kongo.
judge.SetOrder("kon", orders.BuildAnywhere("kon", godip.Army, time.Now()))
judge.Next()
// Check that it was successful.
tst.AssertUnit(t, judge, "kon", godip.Unit{godip.Army, Benin})
}
72 changes: 72 additions & 0 deletions variants/beta/southofsahara/svg/army.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions variants/beta/southofsahara/svg/fleet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,698 changes: 2,698 additions & 0 deletions variants/beta/southofsahara/svg/southofsaharamap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions variants/generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from string import Template

# The name of the variant
VARIANT = 'ThreeKingdoms'

VARIANT = 'SouthofSahara'


# Set to true to create an output map where it's easier to check the regions and centers have the right ids.
OVERRIDE_CHECK_MODE = False
Expand All @@ -33,7 +35,7 @@
LAND_COLOR = '#f4d7b5'
# The thickness of thick lines
#THICK = 2.225
THICK = 1.1125
THICK = 1.0
# The thickness of thin lines
#THIN = 1
THIN = 0.5
Expand Down
24 changes: 24 additions & 0 deletions variants/generator/southofsahara.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The first year of the game
START_YEAR: 1401
# The starting units
START_UNITS:
Benin:
Army: ['Edo','Ife','Owo']
Bonoman:
Army: ['Bono Manso','Begho','Salaga']
Bornu:
Army: ['Njimi','Masseniya','Bilma']
Jolof:
Army: ['Kayor','Baol','Saloum']
Mali:
Army: ['Kumbi Saleh','Walata','Timbuktu','Jenne']
# Abbreviations that should be used (rather than letting the script try to guess an abbreviation).
ABBREVIATIONS:
'Ubangi': 'uba'
# Overrides to swap centers. This only needs to contain something if the greedy algorithm fails.
CENTER_OVERRIDES: [

]
# Overrides to swap region names. This only needs to contain something if the greedy algorithm fails.
REGION_OVERRIDES: [
]
2,911 changes: 2,911 additions & 0 deletions variants/generator/southofsahara_input.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
471 changes: 471 additions & 0 deletions variants/generator/southofsaharadebug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions variants/variants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package variants

import (
"github.com/zond/godip/variants/beta/southofsahara"
"github.com/zond/godip/variants/beta/threekingdoms"
"github.com/zond/godip/variants/ancientmediterranean"
"github.com/zond/godip/variants/canton"
Expand Down Expand Up @@ -34,6 +35,7 @@ func init() {
var Variants = map[string]common.Variant{}

var OrderedVariants = []common.Variant{
southofsahara.SouthofSaharaVariant,
threekingdoms.ThreeKingdomsVariant,
ancientmediterranean.AncientMediterraneanVariant,
canton.CantonVariant,
Expand Down
3 changes: 2 additions & 1 deletion variants/variants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ func addArrow(encoder *xml.Encoder, startProvince godip.Province, endProvince go

// Create svg files which can be inspected manually to check the binary map data is correct.
func TestDrawMaps(t *testing.T) {
if os.Getenv("DRAW_MAPS") != "true" {
// if os.Getenv("DRAW_MAPS") != "true" {
if "true" != "true" {
fmt.Println("Skipping test to draw debug maps. Please use the environment variable DRAW_MAPS=true to enable.")
return
}
Expand Down