JubeatPlus 3.9.11
Loading...
Searching...
No Matches
GameViewController.h
Go to the documentation of this file.
1
17
18#import <QuartzCore/QuartzCore.h>
19#import <UIKit/UIKit.h>
20
21#import "GamePauseView.h"
22#import "SharePlayManager.h"
23
24@class CADisplayLink;
25@class EAGLView;
26@class MainGameRenderer;
27@class NSData;
28@class Sequence;
29@class TuneInfo;
30
31NS_ASSUME_NONNULL_BEGIN
32
36@interface GameViewController : UIViewController <UIPopoverControllerDelegate,
39
46- (instancetype)init;
47
53- (double)getMusicTime;
54
61- (nullable NSString *)soundName:(nullable NSString *)name;
62
67- (void)loadView;
68
75- (void)loadResources;
76
82- (void)releaseResources;
83
88- (void)saveScore;
89
94- (void)startAnimation;
95
100- (void)stopAnimation;
101
107- (void)finishMusic:(nullable NSNotification *)notification;
108
115- (void)loop:(nullable CADisplayLink *)displayLink;
116
122- (void)startGame;
123
128- (void)replayGame;
129
134- (void)restartGame;
135
142- (void)pushBtnReplay:(nullable id)sender;
143
150- (void)pushBtnReplayPause:(nullable id)sender;
151
157- (void)pushBtnPause:(nullable id)sender;
158
163- (void)restartInPauseView;
164
169- (void)resumeInPauseView;
170
175- (void)endInPauseView;
176
181- (void)end;
182
188- (void)sessionDisconnect:(BOOL)showAlert;
189
194- (void)removeEvaluate;
195
201- (void)closeEvaluate:(nullable id)sender;
202
208- (void)sharePlayManagerDisconnect:(nullable SharePlayManager *)manager;
209
216- (void)sharePlayManager:(nullable SharePlayManager *)manager disconnectClient:(nullable id)client;
217
223- (void)sharePlayManagerFailWithError:(nullable SharePlayManager *)manager;
224
230- (void)sharePlayManagerAllClientLoaded:(nullable SharePlayManager *)manager;
231
239- (void)sharePlayManager:(nullable SharePlayManager *)manager startMusicTime:(float)musicTime;
240
246- (void)sharePlayManagerMusicStartTimeOut:(nullable SharePlayManager *)manager;
247
254- (void)sharePlayManager:(nullable SharePlayManager *)manager receiveScore:(int)score;
255
264- (void)sharePlayManager:(nullable SharePlayManager *)manager
265 receiveFinalScore:(int)score
266 bonus:(int)bonus
267 fullCombo:(BOOL)fullCombo;
268
273- (void)suspend;
274
280- (void)resume;
281
287- (void)terminate;
288
294
299- (void)viewDidUnload;
300
306- (void)viewWillAppear:(BOOL)animated;
307
313- (void)viewDidAppear:(BOOL)animated;
314
320- (void)viewWillDisappear:(BOOL)animated;
321
327- (void)viewDidDisappear:(BOOL)animated;
328
335- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
336
343- (UIInterfaceOrientationMask)supportedInterfaceOrientations;
344
350- (BOOL)shouldAutorotate;
351
356- (void)requestAddPlayCount;
357
363- (void)jubeatLabAccessError:(nullable id)access;
364
371- (void)jubeatLabAccessFinished:(nullable id)access;
372
377- (void)dealloc;
378
383- (void)createGoodJobBtn;
384
389- (void)pushBtnGoodJob;
390
395- (void)createTwitterBtn;
396
403- (void)sendTwitter:(nullable UIImage *)image mesStr:(nullable NSString *)mesStr;
404
409- (void)createSearchBtn;
410
416- (void)packIDSearchEnd:(nullable id)packID;
417
423- (void)packIDSearchCancel:(nullable id)sender;
424
431- (void)errorIDDownload:(nullable id)error msgStr:(nullable id)msgStr;
432
438- (void)successIDDownload:(nullable id)sender;
439
446- (void)downloaderFinished:(nullable id)downloader;
447
453- (void)downloaderError:(nullable id)downloader;
454
460
465- (void)makeTouchesData;
466
473- (nullable NSArray *)getTouches;
474
480- (void)tapGesture:(nullable UITapGestureRecognizer *)gesture;
481
487- (int)getDelaySector;
488
493- (void)addGhostTouches;
494
500- (nullable NSString *)getGhostDirectoryPath;
501
506- (void)setReplayData;
507
513- (nullable NSArray *)getGhostTouches;
514
519- (void)sendChallengeScore;
520
527- (void)alertSelect:(nullable NSDictionary *)info;
528
533- (void)panelChanceClose;
534
536@property(nonatomic, strong, nullable) TuneInfo *currentTune;
538@property(nonatomic) unsigned int currentDiff;
540@property(nonatomic, unsafe_unretained, nullable) NSString *currentMarker;
542@property(nonatomic, strong, nullable) SharePlayManager *shareManager;
544@property(nonatomic, strong, nullable) NSData *musicData;
546@property(nonatomic, strong, nullable) EAGLView *glView;
548@property(nonatomic, strong, nullable) MainGameRenderer *mainGameRenderer;
550@property(nonatomic, strong, nullable) CADisplayLink *displayLink;
552@property(nonatomic, strong, nullable) Sequence *sequence;
554@property(nonatomic, strong, nullable) UIButton *btnPause;
556@property(nonatomic, strong, nullable) UIImageView *btnStoreMove;
558@property(nonatomic, strong, nullable) UIImageView *btnGoodJob;
560@property(nonatomic, strong, nullable) UIImageView *goodJobTxt;
562@property(nonatomic, strong, nullable) UIImageView *twitterBtn;
564@property(nonatomic, strong, nullable) GamePauseView *pauseView;
565
566@end
567
568NS_ASSUME_NONNULL_END
569
570// code: language=Objective-C
571// kate: hl Objective-C;
572// vim: set ft=objc :
The in-game pause overlay with resume, restart, and end buttons.
The local multiplayer ("share play" / versus) session manager.
The OpenGL ES 1.1 rendering view backing the game.
Definition EAGLView.h:19
A modal pause overlay themed per the current game theme.
Definition GamePauseView.h:32
The in-game play view controller.
Definition GameViewController.h:38
void saveScore()
Persists the play result to the score records and saves the managed object context.
Definition GameViewController.m:2552
void startGame()
Begins a fresh play: resets the adjust offset, sequence, ghost recording, renderer state,...
Definition GameViewController.m:1569
void sendChallengeScore()
Uploads the challenge-mode score.
Definition GameViewController.m:2631
void suspend()
Suspends the play when backgrounded, stopping animation, BGM, and the session per state.
Definition GameViewController.m:1844
UIImageView * twitterBtn
The Twitter share button.
Definition GameViewController.h:562
int getDelaySector()
The replay delay in sectors between the recorded ghost and live play.
Definition GameViewController.m:2444
NSString * currentMarker
The current marker resource name. Held without ownership, matching the binary.
Definition GameViewController.h:540
void startAnimation()
Starts the per-frame display link that drives loop: .
Definition GameViewController.m:1398
UIImageView * btnStoreMove
The store-move (pack search) button.
Definition GameViewController.h:556
void end()
Dismisses the controller, drops the BGM observer, and returns to music select.
Definition GameViewController.m:1751
NSData * musicData
The compressed music data for the current chart.
Definition GameViewController.h:544
BOOL shouldAutorotate()
Whether the controller may autorotate.
Definition GameViewController.m:1984
void viewDidUnload()
Tears down the OpenGL view and the buttons on view unload.
Definition GameViewController.m:1931
void createTwitterBtn()
Builds the Twitter share button.
Definition GameViewController.m:2282
UIButton * btnPause
The pause / play button.
Definition GameViewController.h:554
void createSearchBtn()
Builds the store-move search button and the pack-ID search overlay.
Definition GameViewController.m:2304
TuneInfo * currentTune
The tune being played.
Definition GameViewController.h:536
void createGoodJobBtn()
Builds the good-job button and its label.
Definition GameViewController.m:2172
nullable NSString * getGhostDirectoryPath()
Resolves the on-disk directory for the current tune's ghost recordings.
Definition GameViewController.m:2490
Sequence * sequence
The note-judgement sequence.
Definition GameViewController.h:552
CADisplayLink * displayLink
The per-frame display link driving loop: .
Definition GameViewController.h:550
void makeTouchesData()
Builds the per-panel touch-recording tables from the debug touch and press tables.
Definition GameViewController.m:2320
void loadResources()
Builds the renderer for the current idiom and theme, decrypts the chart archive into a Sequence and i...
Definition GameViewController.m:1068
UIInterfaceOrientationMask supportedInterfaceOrientations()
The supported interface orientations (portrait only).
Definition GameViewController.m:1979
UIImageView * btnGoodJob
The good-job vote button.
Definition GameViewController.h:558
void releaseSearchPackView()
Removes the pack-ID search overlay and its cover view.
Definition GameViewController.m:2130
void didReceiveMemoryWarning()
Forwards the memory warning to super .
Definition GameViewController.m:1926
MainGameRenderer * mainGameRenderer
The gameplay renderer for the current idiom and theme.
Definition GameViewController.h:548
nullable NSArray * getTouches()
Reads the current frame's touches into the button-state bitmasks and returns the touch list.
Definition GameViewController.m:2370
void loadView()
Installs the OpenGL view, the pause button, and the replay / replay-pause buttons.
Definition GameViewController.m:1043
SharePlayManager * shareManager
The local-multiplayer session manager.
Definition GameViewController.h:542
void replayGame()
Begins a replay of the just-finished play against the recorded ghost.
Definition GameViewController.m:1596
void panelChanceClose()
Panel-chance close: fades out BGM, returns to music select, and ends the result.
Definition GameViewController.m:2163
void stopAnimation()
Stops and releases the per-frame display link.
Definition GameViewController.m:1414
void pushBtnGoodJob()
Good-job button tap: records the good-job vote and commits it through the jubeat-lab API.
Definition GameViewController.m:2210
void addGhostTouches()
Appends the current frame's ghost touches into the recording table.
Definition GameViewController.m:2458
void setReplayData()
Serialises the recorded ghost touches for the just-finished play.
Definition GameViewController.m:2495
void endInPauseView()
Pause-overlay end callback: confirms in challenge mode, otherwise returns to music select.
Definition GameViewController.m:1732
void dealloc()
Stops animation, drops observers, disconnects the session, and tears down the overlays.
Definition GameViewController.m:2036
unsigned int currentDiff
The current difficulty.
Definition GameViewController.h:538
nullable NSArray * getGhostTouches()
Reads the current frame's ghost touches back for replay.
Definition GameViewController.m:2518
instancetype init()
Initialises the controller: reads the saved adjust-sector offset, resolves the device idiom,...
Definition GameViewController.m:997
EAGLView * glView
The OpenGL view.
Definition GameViewController.h:546
void terminate()
Fully stops the play: stops BGM and animation, clears the framebuffer, and resets the renderer.
Definition GameViewController.m:1911
double getMusicTime()
The current BGM playback position, less the adjust-time offset, clamped to zero.
Definition GameViewController.m:1022
GamePauseView * pauseView
The pause overlay.
Definition GameViewController.h:564
void resumeInPauseView()
Pause-overlay resume callback: resumes animation and BGM when still active.
Definition GameViewController.m:1722
void requestAddPlayCount()
Reports a downloaded custom chart's play to the jubeat-lab play-count API.
Definition GameViewController.m:1991
UIImageView * goodJobTxt
The good-job button's caption image.
Definition GameViewController.h:560
void restartInPauseView()
Pause-overlay restart callback: asks the root controller to restart the tune.
Definition GameViewController.m:1717
void restartGame()
Restarts the play from the top, or replays when already replaying.
Definition GameViewController.m:1626
void resume()
Resumes the play when foregrounded, restarting animation or showing the pause overlay per state.
Definition GameViewController.m:1871
void removeEvaluate()
Removes the evaluation overlay and its cover view immediately.
Definition GameViewController.m:1762
void releaseResources()
Tears down the renderer, sequence, framebuffer, audio, overlays, and pending network requests.
Definition GameViewController.m:1349
The abstract base renderer for a play session.
Definition MainGameRenderer.h:73
The core gameplay judgement engine for a single play session.
Definition Sequence.h:102
Manages a two-peer MultipeerConnectivity session for shared ("versus") play.
Definition SharePlayManager.h:142
A tune, its three difficulty levels, and how it sorts.
Definition TuneInfo.h:20
What a GamePauseView tells its owner when a button is tapped.
Definition GamePauseView.h:19
Delegate through which a SharePlayManager reports discovery, connection, data-transfer,...
Definition SharePlayManager.h:28