_internal.classes.focus._tmpl.TemplateFocusable - vladzaharia/bitburner GitHub Wiki
_internal/classes/focus/_tmpl.TemplateFocusable
Focusable managing <>.
-
↳
TemplateFocusable
- _focus
- canFocus
- focus
- getCheckInterval
- getDetailText
- getFocusTime
- getPriority
- shouldContinueRunning
- shouldRunInBackground
• new TemplateFocusable(ns, priority?)
Creates a focuser that manages <>.
| Name | Type | Default value | Description |
|---|---|---|---|
ns |
NS |
undefined |
The Netscript object. |
priority |
number |
Infinity |
Priority this focuser should run at, defaults to <>. |
_internal/classes/focus/_tmpl.ts:18
• Protected _ns: NS
The Netscript object.
_internal/classes/focus/_base.ts:21
• name: string
The name of the focusable.
_internal/classes/focus/_base.ts:18
▸ Protected _focus(): boolean
Execute focus using ns.singularity, must be implemented by subclass.
boolean
Whether the focus action was successful.
_internal/classes/focus/_tmpl.ts:30
▸ canFocus(): boolean
boolean
_internal/classes/focus/_tmpl.ts:26
▸ focus(): number
Executes a focus action, returning a predefined sleep time.
number
_sleepTime if successful, -1 otherwise.
_internal/classes/focus/_base.ts:76
▸ getCheckInterval(): number
Gets how often to check for task completion, defaults to this._checkInterval.
number
How often to check for task completion.
BaseFocusable.getCheckInterval
_internal/classes/focus/_base.ts:118
▸ getDetailText(): string
Returns value from preset field.
string
Value of this._detailField if set, "" otherwise
_internal/classes/focus/_base.ts:137
▸ getFocusTime(): number
Get time needed for task, defaults to this._sleepTime.
number
The time to sleep before running the manager again.
_internal/classes/focus/_tmpl.ts:38
▸ getPriority(): number
Gets the current priority of the focusable action.
number
Current priority, with 0 being the highest.
_internal/classes/focus/_tmpl.ts:22
▸ shouldContinueRunning(): boolean
Checks if the player is still working.
virtual Can be overridden, but run super.shouldContinueRunning if you do.
boolean
True if user is still working, false otherwise.
BaseFocusable.shouldContinueRunning
_internal/classes/focus/_base.ts:128
▸ shouldRunInBackground(): boolean
Checks if the action should run in the background, defaults to if priority is > 50.
boolean
True if this can run in the background, False if it needs to be in the foreground.