128 lines
4.5 KiB
Objective-C
128 lines
4.5 KiB
Objective-C
//
|
|
// XPPKAction.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2024/01/01.
|
|
//
|
|
|
|
#import "XPPKAction.h"
|
|
#import "RoomInfoModel.h"
|
|
|
|
@implementation XPPKAction
|
|
|
|
#pragma mark - 同房PK模式
|
|
|
|
+ (instancetype)roomPKOpenAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter1");
|
|
action.imageName = @"room_pk_menu_icon";
|
|
action.type = RoomMoreMenuType_Room_PK_Open;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)roomPKCloseAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter26");
|
|
action.imageName = @"room_pk_menu_icon";
|
|
action.type = RoomMoreMenuType_Room_PK_Close;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
#pragma mark - 跨房PK
|
|
|
|
+ (instancetype)acrossRoomPKOpenAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter31");
|
|
action.imageName = @"crossroom_pk_menu_icon";
|
|
action.type = RoomMoreMenuType_Room_Across_PK_Open;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)acrossRoomPKCloseAction{
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter31");
|
|
action.imageName = @"crossroom_pk_menu_icon";
|
|
action.type = RoomMoreMenuType_Room_Across_PK_Close;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
#pragma mark - 主播PK
|
|
|
|
+ (instancetype)anchorPKOpenAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter33");
|
|
action.imageName = @"room_more_menu_anchor_pk";
|
|
action.type = RoomMoreMenuType_Room_Anchor_PK_Open;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)anchorPKCloseAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter32");
|
|
action.imageName = @"room_more_menu_anchor_pk";
|
|
action.type = RoomMoreMenuType_Room_Anchor_PK_Close;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
#pragma mark - 相亲模式
|
|
|
|
+ (instancetype)datingOpenAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter8");
|
|
action.imageName = @"room_more_menu_dating";
|
|
action.type = RoomMoreMenuType_Room_Dating_Open;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)datingCloseAction {
|
|
XPPKAction *action = [[XPPKAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter29");
|
|
action.imageName = @"room_more_menu_dating";
|
|
action.type = RoomMoreMenuType_Room_Dating_Close;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
#pragma mark - 根据房间信息创建Action
|
|
+ (instancetype)roomPKActionWithRoomInfo:(RoomInfoModel *)roomInfo {
|
|
return roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? [self roomPKCloseAction] : [self roomPKOpenAction];
|
|
}
|
|
|
|
+ (instancetype)corssPKActionWithRoomInfo:(RoomInfoModel *)roomInfo {
|
|
return roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode ? [self acrossRoomPKCloseAction] : [self acrossRoomPKOpenAction];
|
|
}
|
|
|
|
+ (instancetype)anchorPKActionWithRoomInfo:(RoomInfoModel *)roomInfo {
|
|
XPPKAction *action = roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode ? [self anchorPKCloseAction] : [self anchorPKOpenAction];
|
|
|
|
if (roomInfo.pkState == AcrossRoomPkStateTypePenalty) {
|
|
if ([roomInfo.winUid isEqualToString:[AccountInfoStorage instance].getUid]) {
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter15");
|
|
} else if ([roomInfo.winUid isEqualToString:roomInfo.pkUid]) {
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter14");
|
|
} else {
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter15");
|
|
}
|
|
} else if (roomInfo.pkState == AcrossRoomPkStateTypePenaltyEnd) {
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter15");
|
|
}
|
|
if (roomInfo.pkMatchStartTime) {
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter17");
|
|
}
|
|
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)blindActionWithRoomInfo:(RoomInfoModel *)roomInfo {
|
|
return roomInfo.roomModeType == RoomModeType_Open_Blind ? [self datingCloseAction] : [self datingOpenAction];
|
|
}
|
|
|
|
@end
|