scoreManager implemented flawlessly
This commit is contained in:
+4
-1
@@ -3,6 +3,7 @@ import { useBoard } from './useBoard';
|
||||
import { useCursor } from './useCursor';
|
||||
import { useGameStatus } from './useGameStatus';
|
||||
import { useHeroRender } from './useCursor';
|
||||
import { useScore } from './useScore';
|
||||
|
||||
export function useGame(options: GameOptions, platformHook?: unknown): GameManager {
|
||||
const { cols, rows } = options;
|
||||
@@ -13,8 +14,9 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
|
||||
|
||||
const hero = cursor.hero;
|
||||
const renderer = useHeroRender({ gameStatus: gameStatusManager.gameStatus, board, hero });
|
||||
const scoreManager = useScore({ board, hero, gameStatusManager, keyManager });
|
||||
|
||||
const gameManager = {
|
||||
const gameManager: GameManager = {
|
||||
containerRef,
|
||||
...keyManager,
|
||||
...gameStatusManager,
|
||||
@@ -22,6 +24,7 @@ export function useGame(options: GameOptions, platformHook?: unknown): GameManag
|
||||
cursor,
|
||||
hero,
|
||||
renderer,
|
||||
scoreManager,
|
||||
}
|
||||
|
||||
if (typeof platformHook === 'function') {
|
||||
|
||||
Reference in New Issue
Block a user