66 lines
1.7 KiB
Objective-C
66 lines
1.7 KiB
Objective-C
//
|
||
// GiftAnimationManager.h
|
||
// YuMi
|
||
//
|
||
// Created by P on 2024/12/9.
|
||
//
|
||
|
||
#import <Foundation/Foundation.h>
|
||
@class UIView;
|
||
@class GiftReceiveInfoModel;
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
@protocol GiftAnimationDelegate <NSObject>
|
||
|
||
/**
|
||
* Returns the animation point for a given user ID in the stage view
|
||
* @param uid The user ID to get the animation point for
|
||
* @return CGPoint The point in the view's coordinate system where the animation should occur
|
||
*/
|
||
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid;
|
||
|
||
@optional
|
||
/**
|
||
* Called when a gift animation starts
|
||
* @param giftInfo The gift information model
|
||
*/
|
||
//- (void)didStartGiftAnimation:(GiftInfoModel *)giftInfo;
|
||
|
||
/**
|
||
* Called when a gift animation completes
|
||
* @param giftInfo The gift information model
|
||
*/
|
||
//- (void)didCompleteGiftAnimation:(GiftInfoModel *)giftInfo;
|
||
|
||
/**
|
||
* Called when the gift queue becomes empty
|
||
*/
|
||
- (void)didEmptyGiftQueue;
|
||
|
||
@end
|
||
|
||
@interface GiftAnimationManager : NSObject
|
||
@property (nonatomic, weak) id<GiftAnimationDelegate> delegate;
|
||
@property (nonatomic, strong) UIView *containerView;
|
||
|
||
// Configurable properties
|
||
@property (nonatomic, assign) NSTimeInterval animationInterval;
|
||
@property (nonatomic, assign) NSTimeInterval comboAnimationDelay;
|
||
@property (nonatomic, assign) NSTimeInterval standardAnimationDelay;
|
||
|
||
- (instancetype)initWithContainerView:(UIView *)containerView;
|
||
- (void)enqueueGift:(GiftReceiveInfoModel *)giftInfo;
|
||
- (void)startGiftQueue;
|
||
- (void)stopGiftQueue;
|
||
|
||
// 🔧 新增:Combo状态管理方法
|
||
- (void)setUserComboState:(BOOL)isCombo forUser:(NSString *)uid;
|
||
- (void)clearUserComboState:(NSString *)uid;
|
||
- (void)updateUserGiftTime:(NSString *)uid;
|
||
- (void)cleanupExpiredStates;
|
||
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|