/tg/ Station 13 - Modules - TypesVar Details - Proc Details

move_loop

Template class of the movement datums, handles the timing portion of the loops

Vars

controllerThe subsystem we're processing on
delayDelay between each move in deci-seconds
extra_infoAn extra reference we pass around It is on occasion useful to have a reference to some datum without storing it on the moving object Mostly comes up in high performance senarios where we care about things being singletons This feels horrible, but constantly making components seems worse
flagsBitfield of different things that affect how a loop operates, and other mechanics around it as well.
lifetimeTime till we stop processing in deci-seconds, defaults to forever
movingThe thing we're moving about
ownerThe movement packet that owns us
priorityDefines how different move loops override each other. Higher numbers beat lower numbers
queued_timeThe time we are CURRENTLY queued for processing Do not modify this directly
statusStatus bitfield for what state the move loop is currently in
timerThe next time we should process Used primarially as a hint to be reasoned about by our [controller], and as the id of our bucket

Procs

compare_loopscheck if this exact moveloop datum already exists (in terms of vars) so we can avoid creating a new one to overwrite the old duplicate
loop_startedCalled when a loop is starting by a movement subsystem
loop_stoppedCalled when a loop is stopped, doesn't stop the loop itself
moveHandles the actual move, overriden by children Returns FALSE if nothing happen, TRUE otherwise
pause_forPauses the move loop for some passed in period This functionally means shifting its timer up, and clearing it from its current bucket
pause_loopPause our loop untill restarted with resume_loop()
resume_loopResume our loop after being paused by pause_loop()
set_delayExists as a helper so outside code can modify delay in a sane way

Var Details

controller

The subsystem we're processing on

delay

Delay between each move in deci-seconds

extra_info

An extra reference we pass around It is on occasion useful to have a reference to some datum without storing it on the moving object Mostly comes up in high performance senarios where we care about things being singletons This feels horrible, but constantly making components seems worse

flags

Bitfield of different things that affect how a loop operates, and other mechanics around it as well.

lifetime

Time till we stop processing in deci-seconds, defaults to forever

moving

The thing we're moving about

owner

The movement packet that owns us

priority

Defines how different move loops override each other. Higher numbers beat lower numbers

queued_time

The time we are CURRENTLY queued for processing Do not modify this directly

status

Status bitfield for what state the move loop is currently in

timer

The next time we should process Used primarially as a hint to be reasoned about by our [controller], and as the id of our bucket

Proc Details

compare_loops

check if this exact moveloop datum already exists (in terms of vars) so we can avoid creating a new one to overwrite the old duplicate

loop_started

Called when a loop is starting by a movement subsystem

loop_stopped

Called when a loop is stopped, doesn't stop the loop itself

move

Handles the actual move, overriden by children Returns FALSE if nothing happen, TRUE otherwise

pause_for

Pauses the move loop for some passed in period This functionally means shifting its timer up, and clearing it from its current bucket

pause_loop

Pause our loop untill restarted with resume_loop()

resume_loop

Resume our loop after being paused by pause_loop()

set_delay

Exists as a helper so outside code can modify delay in a sane way