Documentation
¶
Index ¶
- type State
- func (s *State) BurnOutTorch(pos cube.Pos)
- func (s *State) ClearTorchBurnout(pos cube.Pos)
- func (s *State) MarkTorchSelfTriggeredIfActive(pos cube.Pos)
- func (s *State) PruneTorchBurnout(pos cube.Pos, currentTick int64)
- func (s *State) RecordTorchToggle(pos cube.Pos, currentTick int64) (burnsOut bool)
- func (s *State) TorchBurnoutStatus(pos cube.Pos, currentTick int64) (burnedOut, recoverable bool)
- func (s *State) UpdateSource() (cube.Pos, bool)
- func (s *State) WithActiveTorchUpdate(pos cube.Pos, fn func())
- func (s *State) WithUpdateSource(pos cube.Pos, fn func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State holds transient redstone runtime state owned by a world.
func (*State) BurnOutTorch ¶
BurnOutTorch marks a redstone torch as burned out until a later redstone update recovers it.
func (*State) ClearTorchBurnout ¶
ClearTorchBurnout removes transient burnout state for a redstone torch.
func (*State) MarkTorchSelfTriggeredIfActive ¶
MarkTorchSelfTriggeredIfActive marks the next scheduled tick for the redstone torch at pos as self-triggered if the current redstone propagation originated from that torch.
func (*State) PruneTorchBurnout ¶
PruneTorchBurnout removes idle redstone torch burnout state once all tracked state changes have expired.
func (*State) RecordTorchToggle ¶
RecordTorchToggle records a self-triggered redstone torch toggle and reports whether it should burn out.
func (*State) TorchBurnoutStatus ¶
TorchBurnoutStatus returns the current transient burnout state for a redstone torch. Expired state-change history is pruned before the state is returned.
func (*State) UpdateSource ¶
UpdateSource returns the position that caused the current redstone update.
func (*State) WithActiveTorchUpdate ¶
WithActiveTorchUpdate marks redstone propagation as originating from the redstone torch at pos for the duration of fn.
func (*State) WithUpdateSource ¶
WithUpdateSource marks redstone propagation as originating from pos for the duration of fn.