Пример #1
0
func Init(e, d bool, n uint, s string) {
	//
	if initialisiert {
		Graph.Terminate()
	} else {
		scr.Switch(scr.WVGApp)
		initialisiert = true
	}
	Ecke = node.New(n)
	Ecke1 = node.New(n)
	tempEcke = node.New(n)
	tempEcke1 = node.New(n)
	Kante = edge.New()
	tempKante = edge.New()
	Graph = gra.New(d, Ecke, Kante)
	edge.WithValues = e
	Dateiname := ""
	str.RemAllSpaces(&s)
	if str.Empty(s) {
		Dateiname = "temp"
	} else {
		Dateiname = s
	}
	//  sel.DateinameEditieren (Dateiname)
	Graph.Name(Dateiname + "." + "gra")
}
Пример #2
0
	"murus/scr"
	"murus/str"
	"murus/sub/bahnhof"
	"murus/sub/gleis"
	. "murus/sub/linie"
)

const (
	pack = "murus/sub/netz" // 292 Bahnhöfe
	tU   = 5                // stark vereinfacht: universelle Zeit zum Umsteigen // TODO
)

var (
	_bhf   *bahnhof.Imp = bahnhof.New()
	_gleis *gleis.Imp   = gleis.New()
	netz   *gra.Imp     = gra.New(false, _bhf, _gleis)
	help   []string
)

// Eff.: Aktuelle Ecke ist (L, n), postaktuelle Ecke ist die, die vorher aktuell war.
func ins(l Linie, nr uint, n, n1 string, b byte, y, x float64) {
	//
	_bhf.Def(l, nr, n, n1, b, y, x)
	netz.Ins(_bhf)
}

// Eff.: Aktuelle Ecke ist (L, n), postaktuelle Ecke ist die, die vorher aktuell war.
func ins1(l Linie, nr uint, n, n1 string, b byte, y, x float64, t uint) {
	//
	ins(l, nr, n, n1, b, y, x)
	_gleis.Def(l, t)