refactor: update pet action handling and restructure pet types for better clarity

This commit is contained in:
2025-02-01 15:33:42 -03:00
parent 8875eb75af
commit a85a80938b
11 changed files with 226 additions and 216 deletions

View File

@@ -1,10 +1,10 @@
import { PetAction } from '../types/PetUpdateActionRequest';
import { PetGatherAction } from '../types/PetUpdateActionRequest';
export function isGatheringAction(action: PetAction): boolean {
export function isGatheringAction(action: PetGatherAction): boolean {
return action.startsWith('GATHERING_');
}
export function getResourceFromAction(action: PetAction): string | null {
export function getResourceFromAction(action: PetGatherAction): string | null {
if (!isGatheringAction(action)) return null;
return action.replace('GATHERING_', '').toLowerCase();
}