@lands.io/mod-sdk / BuildDefensePostActionHooks
Interface: BuildDefensePostActionHooks¶
Hooks for customizing BuildDefensePostAction behavior.
Table of contents¶
Properties¶
Properties¶
canActivate¶
• Optional canActivate: (ctx: ActionContext, allowed: boolean) => boolean
Hook for canActivate - receives context and base allowed result
Type declaration¶
▸ (ctx, allowed): boolean
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
allowed |
boolean |
Returns¶
boolean
createExecution¶
• Optional createExecution: (ctx: ActionContext, target: BuildDefensePostTarget, execution: Execution) => Execution
Hook for createExecution - receives context, target, and base execution
Type declaration¶
▸ (ctx, target, execution): Execution
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
target |
BuildDefensePostTarget |
execution |
Execution |
Returns¶
getCost¶
• Optional getCost: (ctx: ActionContext, cost: number) => number
Hook for getCost - receives context and base cost
Type declaration¶
▸ (ctx, cost): number
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
cost |
number |
Returns¶
number
Source Code¶
View full implementation
/**
* Hooks for customizing BuildDefensePostAction behavior.
*/
export interface BuildDefensePostActionHooks {
/** Hook for canActivate - receives context and base allowed result */
canActivate?: (ctx: ActionContext, allowed: boolean) => boolean;
/** Hook for createExecution - receives context, target, and base execution */
createExecution?: (
ctx: ActionContext,
target: BuildDefensePostTarget,
execution: Execution
) => Execution;
/** Hook for getCost - receives context and base cost */
getCost?: (ctx: ActionContext, cost: number) => number;
}