Fishingrod Replica
Overview
This component acts as a client-side replica that mirrors key state properties (_target, _hashookedfish, _hascaughtfish) of a remote fishing rod entity. It does not modify local game state directly but exposes and manages synchronized networked values for display, logic, or UI purposes on non-authoritative instances.
Dependencies & Tags
- Uses
net_entity()andnet_bool()for networked property management. - No explicit component additions or tag modifications observed.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
_target | net_entity | nil | Networked reference to the target entity (e.g., fish or object being fished). |
_hashookedfish | net_bool | false | Networked flag indicating whether the rod is currently hooked on a fish. |
_hascaughtfish | net_bool | false | Networked flag indicating whether a fish has been successfully caught. |
Main Functions
SetTarget(target)
- Description: Sets the networked target entity for this replica.
- Parameters:
target(entityornil): The entity to set as the fishing target.
GetTarget()
- Description: Returns the current value of the networked target entity.
- Parameters: None.
SetHookedFish(hookedfish)
- Description: Sets the
_hashookedfishflag totrueifhookedfishis non-nil, otherwisefalse. Updates the networked boolean. - Parameters:
hookedfish(entityornil): Indicates whether a fish is currently hooked.
HasHookedFish()
- Description: Returns
trueonly if_hashookedfishis true and_targetis notnil. Ensures consistency with actual target presence. - Parameters: None.
SetCaughtFish(caughtfish)
- Description: Sets the
_hascaughtfishflag totrueifcaughtfishis non-nil, otherwisefalse. Updates the networked boolean. - Parameters:
caughtfish(entityornil): Indicates whether a fish has been caught.
HasCaughtFish()
- Description: Returns
trueif_hascaughtfishis true, indicating a fish is currently held. - Parameters: None.
Events & Listeners
None.