27 lines
952 B
TypeScript
27 lines
952 B
TypeScript
// UE/InputMappingContext.ts
|
|
|
|
import { DataAsset } from '#root/UE/DataAsset.ts';
|
|
import { EnhancedActionKeyMapping } from '#root/UE/EnhancedActionKeyMapping.ts';
|
|
import type { InputAction } from '#root/UE/InputAction.ts';
|
|
import type { InputModifier } from '#root/UE/InputModifier.ts';
|
|
import type { InputTrigger } from '#root/UE/InputTrigger.ts';
|
|
import type { Key } from '#root/UE/Key.ts';
|
|
import { Name } from '#root/UE/Name.ts';
|
|
import type { UEArray } from '#root/UE/UEArray.ts';
|
|
import type { UEObject } from '#root/UE/UEObject.ts';
|
|
|
|
export class InputMappingContext extends DataAsset {
|
|
constructor(outer: UEObject | null = null, name: Name | string = Name.NONE) {
|
|
super(outer, name);
|
|
}
|
|
|
|
public mapKey(action: InputAction, toKey: Key): EnhancedActionKeyMapping {
|
|
return new EnhancedActionKeyMapping(
|
|
[] as unknown as UEArray<InputTrigger>,
|
|
[] as unknown as UEArray<InputModifier>,
|
|
action,
|
|
toKey
|
|
);
|
|
}
|
|
}
|