房间游戏

This commit is contained in:
liyuhua
2024-05-28 18:05:54 +08:00
parent 0732e4c46f
commit 1012ca0f5b
2 changed files with 145 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
//
// MSRoomGameVC.h
// YuMi
//
// Created by duoban on 2024/5/27.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MSRoomGameVC : MvpViewController
- (instancetype)initWithRoomUid:(NSString *)roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,129 @@
//
// MSRoomGameVC.m
// YuMi
//
// Created by duoban on 2024/5/27.
//
#import "MSRoomGameVC.h"
#import "MSRoomGameHeadView.h"
#import "MsRoomMessagChatHallView.h"
#import "MSRoomGameMsgView.h"
#import "MSRoomGameSendMsgView.h"
#import "XPRoomLittleGameContainerView.h"
#import "MSRoomGameVictoryView.h"
#import "MSRoomGameQuitGameView.h"
@interface MSRoomGameVC ()<MSRoomGameHeadViewDelegate,MSRoomGameQuitGameViewDelegate,MSRoomGameVictoryViewDelegate>
@property(nonatomic,strong) UIImageView *bgImageView;
@property(nonatomic,strong) MSRoomGameHeadView *headView;
@property(nonatomic,strong) MsRoomMessagChatHallView *chatView;
@property(nonatomic,strong) MSRoomGameMsgView *msgView;
@property (nonatomic,copy)NSString *roomUid;
@property(nonatomic,strong) MSRoomGameSendMsgView *sendMsgView;
///
@property (nonatomic,strong) XPRoomLittleGameContainerView *littleGameView;
@end
@implementation MSRoomGameVC
- (instancetype)initWithRoomUid:(NSString *)roomUid {
self = [super init];
if (self) {
self.roomUid = roomUid;
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self installUI];
[self installConstraints];
}
-(void)installUI{
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.littleGameView];
[self.view addSubview:self.headView];
[self.view addSubview:self.msgView];
[self.view addSubview:self.sendMsgView];
}
-(void)installConstraints{
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[self.littleGameView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight);
make.leading.trailing.equalTo(self.view).inset(kGetScaleWidth(0));
make.height.mas_equalTo(kGetScaleWidth(236));
}];
[self.sendMsgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(70));
}];
[self.msgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(101));
make.bottom.equalTo(self.sendMsgView.mas_top).mas_offset(-kGetScaleWidth(10));
}];
}
- (BOOL)isHiddenNavBar {
return YES;
}
#pragma mark -MSRoomGameVictoryViewDelegate
- (void)closeGameAction{
}
-(void)rematchGameAction{
}
#pragma mark - MSRoomGameQuitGameViewDelegate
- (void)quitGameAction{
}
#pragma mark -MSRoomGameHeadViewDelegate
- (void)clickQuitGameAction{
// MSRoomGameQuitGameView *quitGameView = [[MSRoomGameQuitGameView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
// quitGameView.delegate = self;
// [TTPopup popupView:quitGameView style:TTPopupStyleAlert];
MSRoomGameVictoryView *victoryView = [[MSRoomGameVictoryView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
victoryView.delegate = self;
[TTPopup popupView:victoryView style:TTPopupStyleAlert];
}
#pragma mark -
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.image = kImage(@"ms_room_game_underwa_bg");
_bgImageView.userInteractionEnabled = YES;
}
return _bgImageView;
}
- (MSRoomGameHeadView *)headView{
if(!_headView){
_headView = [[MSRoomGameHeadView alloc]initWithFrame:CGRectZero];
_headView.delegate = self;
}
return _headView;
}
- (MSRoomGameMsgView *)msgView{
if(!_msgView){
_msgView = [[MSRoomGameMsgView alloc]initWithRoomUid:self.roomUid];
}
return _msgView;
}
- (MSRoomGameSendMsgView *)sendMsgView{
if(!_sendMsgView){
_sendMsgView = [[MSRoomGameSendMsgView alloc]initWithFrame:CGRectZero];
}
return _sendMsgView;
}
- (XPRoomLittleGameContainerView *)littleGameView {
if (!_littleGameView) {
_littleGameView = [[XPRoomLittleGameContainerView alloc] initWithDelegate:self];
_littleGameView.delegate = self;
}
return _littleGameView;
}
@end