refactor: update pet action handling and restructure pet types for better clarity
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user