Esempio n. 1
0
File: team.go Progetto: obowersa/crg
func (t *team) updatePositions() {
	t.jammer = ""
	t.pivot = ""
	statemanager.StateDelete(t.base + ".Jammer")
	statemanager.StateDelete(t.base + ".Pivot")
	t.sb.activeJam.clearTeamPositions(t)
	for _, s := range t.skaters {
		t.sb.activeJam.setTeamPosition(s)
		if s.position == positionJammer {
			t.jammer = s.id
			statemanager.StateUpdateString(t.base+".Jammer.ID", s.id)
			statemanager.StateUpdateString(t.base+".Jammer.Name", s.name)
			statemanager.StateUpdateString(t.base+".Jammer.Number", s.number)
			statemanager.StateUpdateBool(t.base+".Jammer.InBox", s.inBox())
		} else if s.position == positionPivot {
			t.pivot = s.id
			statemanager.StateUpdateString(t.base+".Pivot.ID", s.id)
			statemanager.StateUpdateString(t.base+".Pivot.Name", s.name)
			statemanager.StateUpdateString(t.base+".Pivot.Number", s.number)
			statemanager.StateUpdateBool(t.base+".Pivot.InBox", s.inBox())
		}
	}
}
Esempio n. 2
0
func (s *skater) setInBox(v bool) error {
	if s.position == positionBench && v {
		return errSkaterOnBench
	}

	if !v {
		if s.curBoxTrip == nil {
			return errSkaterNotInBox
		}
		s.curBoxTrip.setOutJamIdx(int64(len(s.t.sb.jams) - 1))
		s.curBoxTrip = nil
	} else {
		s.curBoxTrip = newBoxTrip(s, int64(len(s.t.sb.jams)-1), false, s.t.starPass)
		s.boxTrips = append(s.boxTrips, s.curBoxTrip)
	}

	if s.position == positionJammer || s.position == positionPivot {
		s.t.updatePositions()
	}

	return statemanager.StateUpdateBool(s.stateIDs["inBox"], v)
}
Esempio n. 3
0
func (c *clock) setCountDown(countdown bool) error {
	c.countdown = countdown
	statemanager.StateUpdateBool(c.stateIDs["countdown"], countdown)
	c.time.setCountDown(countdown)
	return nil
}
Esempio n. 4
0
func (c *clock) setAdjustable(adjustable bool) {
	c.adjustable = adjustable
	statemanager.StateUpdateBool(c.stateIDs["adjustable"], adjustable)
}
Esempio n. 5
0
func (c *clock) stop() {
	c.running = false
	statemanager.StateUpdateBool(c.stateIDs["running"], c.running)
}
Esempio n. 6
0
func (c *clock) start() {
	c.running = true
	statemanager.StateUpdateBool(c.stateIDs["running"], c.running)
}
Esempio n. 7
0
func (t *stateSnapshotTeam) setOfficialReviewRetained(v bool) {
	t.officialReviewRetained = v
	statemanager.StateUpdateBool(t.base+".OfficialReviewRetained", v)
}
Esempio n. 8
0
func (bt *boxTrip) setOutAfterStarPass(v bool) {
	bt.out.afterStarPass = v
	statemanager.StateUpdateBool(bt.stateIDs["out.afterStarPass"], v)
}
Esempio n. 9
0
File: team.go Progetto: obowersa/crg
func (t *team) setStarPass(v bool) error {
	t.starPass = v
	return statemanager.StateUpdateBool(t.stateIDs["starPass"], v)
}
Esempio n. 10
0
func (ss *stateSnapshot) setInProgress(v bool) {
	ss.inProgress = v
	statemanager.StateUpdateBool(ss.stateIDs["inProgress"], v)
}
Esempio n. 11
0
func (s *skater) setInLastJam(v bool) error {
	return statemanager.StateUpdateBool(s.stateIDs["inLastJam"], v)
}
Esempio n. 12
0
func (s *skater) setIsBenchStaff(v bool) error {
	s.isBenchStaff = v
	s.setDescription()
	return statemanager.StateUpdateBool(s.stateIDs["isBenchStaff"], v)
}
Esempio n. 13
0
func (s *skater) setIsAltCaptain(v bool) error {
	s.isAltCaptain = v
	s.setDescription()
	return statemanager.StateUpdateBool(s.stateIDs["isAltCaptain"], v)
}
Esempio n. 14
0
func (bt *boxTrip) setInAfterStarPass(v bool) {
	bt.in.afterStarPass = v
	statemanager.StateUpdateBool(bt.stateIDs["in.afterStarPass"], v)
}
Esempio n. 15
0
func (bt *boxTrip) setInBetweenJams(v bool) {
	bt.in.betweenJams = v
	statemanager.StateUpdateBool(bt.stateIDs["in.betweenJams"], v)
}
Esempio n. 16
0
func (c *clock) setRunning(running bool) error {
	c.running = running
	statemanager.StateUpdateBool(c.stateIDs["running"], running)
	return nil
}
Esempio n. 17
0
File: team.go Progetto: obowersa/crg
func (t *team) setOfficialReviewRetained(v bool) error {
	t.officialReviewRetained = v
	return statemanager.StateUpdateBool(t.stateIDs["officialReviewRetained"], v)
}
Esempio n. 18
0
func (ss *stateSnapshot) setCanRevert(v bool) {
	ss.canRevert = v
	statemanager.StateUpdateBool(ss.stateIDs["canRevert"], v)
}
Esempio n. 19
0
func (c *stateSnapshotClock) setRunning(v bool) {
	c.running = v
	statemanager.StateUpdateBool(c.base+".Running", v)
}
Esempio n. 20
0
func (bt *boxTrip) setOutBetweenJams(v bool) {
	bt.out.betweenJams = v
	statemanager.StateUpdateBool(bt.stateIDs["out.betweenJams"], v)
}