Module LaserDetectorUnit
Detect the hit of a laser.
Element class: LaserDetectorUnit
Extends: Element > ElementWithState
Functions
| isHit () | Checks if any laser is hitting the detector. | 
| getSignalOut (plug) | Return the value of a signal in the specified OUT plug of the element. | 
| EVENT_laserHit () | Deprecated: Event: A laser has just hit the detector. | 
| EVENT_onHit () | Event: Emitted when a laser hit the detector. | 
| EVENT_laserRelease () | Deprecated: Event: All lasers have stopped hitting the detector. | 
| EVENT_onLoss () | Event: Emitted when all lasers stop hitting the detector. | 
| mockRegisterLaserHit (callback) | Mock only, not in-game: Register a handler for the in-game `laserHit()` event. | 
| mockDoLaserHit () | Mock only, not in-game: Simulates the laser hitting the detector. | 
| mockRegisterLaserRelease (callback) | Mock only, not in-game: Register a handler for the in-game `laserRelease()` event. | 
| mockDoLaserRelease () | Mock only, not in-game: Simulates the laser stopping hitting the detector. | 
| mockGetClosure () | Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":". | 
Functions
- isHit ()
 - 
    Checks if any laser is hitting the detector.
    
Returns:
- 
           0/1
        1 if a laser is hitting the detector.
    
 
 - getSignalOut (plug)
 - 
    Return the value of a signal in the specified OUT plug of the element.
Valid plug names are:
- "out" for the out signal.
 
Parameters:
- plug string A valid plug name to query.
 
Returns:
- 
           0/1
        The plug signal state
    
 
 - EVENT_laserHit ()
 - 
    Deprecated: Event: A laser has just hit the detector.
Note: This is documentation on an event handler, not a callable method.
This event is deprecated: EVENT_onHit should be used instead.
See also:
 - EVENT_onHit ()
 - 
    Event: Emitted when a laser hit the detector.
Note: This is documentation on an event handler, not a callable method.
 - EVENT_laserRelease ()
 - 
    Deprecated: Event: All lasers have stopped hitting the detector.
Note: This is documentation on an event handler, not a callable method.
This event is deprecated: EVENT_onLoss should be used instead.
See also:
 - EVENT_onLoss ()
 - 
    Event: Emitted when all lasers stop hitting the detector.
Note: This is documentation on an event handler, not a callable method.
 - mockRegisterLaserHit (callback)
 - 
    Mock only, not in-game: Register a handler for the in-game `laserHit()` event.
    
Parameters:
- callback function The function to call when the laser hits.
 
Returns:
- 
           int
        The index of the callback.
    
 
See also:
 - mockDoLaserHit ()
 - 
    Mock only, not in-game: Simulates the laser hitting the detector.  Calling this while the detector is already
 deactivated is invalid and will have no effect.
Note: currently fires three times when a laser activates it. Release does not.
 - mockRegisterLaserRelease (callback)
 - 
    Mock only, not in-game: Register a handler for the in-game `laserRelease()` event.
    
Parameters:
- callback function The function to call when the lasers stop hitting.
 
Returns:
- 
           int
        The index of the callback.
    
 
See also:
 - mockDoLaserRelease ()
 - Mock only, not in-game: Simulates the laser stopping hitting the detector. Calling this while the detector is already deactivated is invalid and will have no effect.
 - mockGetClosure ()
 - 
    Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".
    
Returns:
- 
           table
        A table encompasing the api calls of object.
    
 
See also: