Papereraser
Overview
The Papereraser component allows an entity (typically a tool like the Paper Eraser) to interact with erasable paper items. It attaches the "papereraser" tag to the entity and provides a DoErase method that invokes the ErasablePaper component’s erasure logic on a target paper item. It ensures proper tag cleanup when removed from an entity.
Dependencies & Tags
Tags: Adds "papereraser" tag on construction; removes it on removal via OnRemoveFromEntity.
Component Dependencies: Relies on the target entity having the erasablepaper component for erasure to succeed.
Properties
No public properties are explicitly declared or initialized in the constructor or elsewhere. All initialization logic is minimal and tag-based.
Main Functions
DoErase(paper, doer)
- Description: Attempts to erase the given
paperitem using this eraser’s capability. Returnstrueif the erasure succeeds (i.e., the underlyingerasablepaper:DoErasecall returns a non-nil result), otherwisefalse. - Parameters:
paper: The entity representing the paper item to erase. Must have anerasablepapercomponent.doer: The entity performing the erasure (typically the player).
Events & Listeners
None identified.