// 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) }
// 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) }
func gew() bool { // var dummy *bahnhof.Imp for { // ok:= false c, _ := kbd.Command() scr.MouseCursor(true) switch c { case kbd.Esc: return false case kbd.Enter, kbd.Back, kbd.Left, kbd.Right, kbd.Up, kbd.Down: dummy.SkalaEditieren() write(false) case kbd.Help: errh.WriteHelp(help) case kbd.Hither: if netz.ExPred(func(a Any) bool { return a.(*bahnhof.Imp).UnterMaus() }) { return true } case kbd.There, kbd.Push, kbd.Thither: dummy.SkalaEditieren() write(false) /* case kbd.This: ok = netz.ExPred (func (a Any) bool { return a.(*bahnhof.Imp).UnterMaus() }) case kbd.Push: x, y:= scr.MousePosGr () if ok { bhf:= netz.Get ().(*bahnhof.Imp) bhf.Rescale (uint(x), uint(y)) netz.Put (bhf) write (false) } */ case kbd.PrintScr: errh.DelHint() img.Print1() } } return false }