コード例 #1
0
ファイル: imp.go プロジェクト: CaptainSoOmA/Uni
// Eff.: s. ins1
func insert1(l Linie, n uint, l0 Linie, n0, u, t uint) {
	//
	// aktuell: vorherige aktuelle
	netz.Reposition()
	var bhf *bahnhof.Imp
	// aktuell: vorherige aktuelle, postaktuell: alt.
	if netz.ExPred(func(a Any) bool { b := a.(*bahnhof.Imp); return b.Linie() == l0 && b.Nummer() == n0 }) {
		// aktuell: (L0, n0), postaktuell: vorherige aktuelle
		bhf = netz.Get().(*bahnhof.Imp)
	} else {
		errh.Error2("fehlt: Linie", uint(l0), "Bhf", n0)
		ker.Stop(pack, 2)
	}
	netz.Reposition()
	// aktuell: vorherige aktuelle, postaktuell: (l0, n0)
	bhf1 := bhf.Clone().(*bahnhof.Imp)
	bhf1.Numerieren(l, n)
	bhf1.Umstieg()
	netz.Ins(bhf1)
	// aktuell: (l, n), postaktuell: vorherige aktuelle
	_gleis.Def(l, t)
	netz.Edge1(_gleis)
	// verbunden: vorherige aktuelle mit (l, n), aktuell: (l, n).
	edge(l0, n0, l, n, u)
	// postaktuell: (l0, n0), aktuell: (l, n)
}
コード例 #2
0
ファイル: imp.go プロジェクト: CaptainSoOmA/Uni
// Eff.: s. ins
func insert(l Linie, n uint, l0 Linie, n0, u uint) {
	//
	var bhf *bahnhof.Imp
	if netz.ExPred(func(a Any) bool { b := a.(*bahnhof.Imp); return b.Linie() == l0 && b.Nummer() == n0 }) {
		bhf = netz.Get().(*bahnhof.Imp)
	} else {
		errh.Error2("fehlt: Linie", uint(l0), "Bhf", n0)
		ker.Stop(pack, 1)
	}
	// aktuell: (l0, n0)
	bhf1 := bhf.Clone().(*bahnhof.Imp)
	bhf1.Numerieren(l, n)
	bhf1.Umstieg()
	netz.Ins(bhf1)
	edge(l0, n0, l, n, u)
	// postaktuell: (l0, n0), aktuell: (l, n)
}