refactor: integrate key management into cursor module
- Move useKeyBindings functionality into useCursor as useGameKeys - Flatten GameManager interface using intersection types - Rename clearLog/getLog to clearKeyLog/getKeyLog for clarity - Remove separate useKeyBindings module and exports - Update all documentation to reflect new architecture - Maintain backward compatibility for platform hooks
This commit is contained in:
+3
-9
@@ -8,15 +8,9 @@ export type GameStatus = 'waiting' | 'started' | 'hasKey' | 'paused' | 'game-ove
|
||||
|
||||
export type GameManager = {
|
||||
containerRef: RefObject<HTMLDivElement | null>;
|
||||
gameStatus: GameStatus;
|
||||
renderBoard: () => void;
|
||||
startGame: () => void;
|
||||
togglePause: (pause?: boolean) => void;
|
||||
quitGame: () => void;
|
||||
|
||||
cursor: Cursor;
|
||||
keyManager: GameKeyManager;
|
||||
};
|
||||
} & GameStatusManager & GameKeyManager;
|
||||
|
||||
|
||||
export type BoardManager = {
|
||||
@@ -55,8 +49,8 @@ export type KeyLogEntry = { key: string; timestamp: number };
|
||||
|
||||
export type GameKeyManager = {
|
||||
keyLog: KeyLogEntry[];
|
||||
clearLog: () => void;
|
||||
getLog: () => KeyLogEntry[];
|
||||
clearKeyLog: () => void;
|
||||
getKeyLog: () => KeyLogEntry[];
|
||||
};
|
||||
|
||||
export type GameStatusManager = {
|
||||
|
||||
Reference in New Issue
Block a user