15#import <Foundation/Foundation.h>
16#import <UIKit/UIKit.h>
22NS_ASSUME_NONNULL_BEGIN
29#pragma mark - Singleton
40#pragma mark - Lifecycle
61- (void)initWithDictionary:(nullable NSDictionary *)dictionary;
63#pragma mark - State updates
72- (void)updateState:(nullable NSDictionary *)dictionary;
80- (void)updateConsume:(nullable NSDictionary *)dictionary;
87- (void)updateName:(nullable NSString *)name;
96- (void)setScratchItem:(int)index dict:(nullable NSDictionary *)dict;
103- (void)updatePresentNum:(nullable NSDictionary *)dictionary;
110- (void)setPresentNum:(int)num;
118- (void)updateScratchID:(nullable NSDictionary *)dictionary;
125- (void)updateHowtoURL:(nullable NSDictionary *)dictionary;
132- (void)updateInformationURL:(nullable NSDictionary *)dictionary;
146- (void)updatePersonalInformationURL:(nullable NSDictionary *)dictionary;
169- (void)updateScratchTable:(nullable NSDictionary *)dictionary;
176- (void)updateScratchLineup:(nullable NSDictionary *)dictionary;
184- (void)updateUserInfo:(nullable NSDictionary *)dictionary;
191- (void)updateScratchTimeState:(nullable NSDictionary *)dictionary;
199- (void)updateServerTime:(nullable NSDictionary *)dictionary;
206- (void)updateCubeState:(nullable NSDictionary *)dictionary;
214- (void)updateCoinState:(nullable NSDictionary *)dictionary;
221- (void)updateNailState:(nullable NSDictionary *)dictionary;
235- (void)updateChallengeMission:(nullable NSDictionary *)dictionary;
242- (void)exchangeNail:(nullable NSDictionary *)dictionary;
251- (void)openScratch:(nullable NSDictionary *)dictionary index:(int)index;
258- (void)restPlayCoin:(nullable NSDictionary *)dictionary;
265- (void)changeScratchNail:(nullable NSDictionary *)dictionary;
272- (void)cubePurchaseSuccess:(nullable NSDictionary *)dictionary;
281- (void)openMusicDetail:(nullable NSDictionary *)dictionary index:(int)index;
288- (void)playMusic:(nullable NSDictionary *)dictionary;
295- (void)receivePresent:(nullable NSDictionary *)dictionary;
305- (void)updateMusicRanking:(int)musicID diff:(int)diff rank:(int)rank index:(int)index;
307#pragma mark - Derived time values
315- (nullable NSString *)timeStringFromInterval_Minute:(double)interval;
323- (nullable NSString *)timeStringFromInterval:(double)interval;
331- (double)getTimeLeft:(nullable NSDate *)date;
339- (double)getMusicEnableTime:(int)index;
347- (nullable NSString *)getMusicEnableTimeString:(int)index;
349#pragma mark - Line-up image cache
357- (void)setLineupImage:(nullable UIImage *)image musicID:(nullable id)musicID;
365- (nullable UIImage *)getLineupImage:(nullable id)musicID;
373#pragma mark - Scratch panel counts
391#pragma mark - Notifications
403#pragma mark - Mission sheets
410- (void)updateMissionSheet:(nullable NSDictionary *)dictionary;
447#pragma mark - Properties
460@property(nonatomic, strong, nullable) NSString *
myName;
470@property(nonatomic, strong, readonly, nullable) NSNumber *
scratchID;
505@property(nonatomic, strong, readonly, nullable) NSArray *
stampTable;
573@property(nonatomic, strong, nullable) NSString *
howtoURL;
A challenge mission sheet's identity, dates, reward, and mission tables.
Definition ChallengeMissionSheet.h:24
The scratch challenge-mode root container.
Definition ChallengeModeRootView.h:55
Shared state for the challenge mode, including the play-coin economy.
Definition ChallengeStatus.h:28
nullable ChallengeMissionSheet * getSelectedMissionSheet()
The currently selected mission sheet, looked up in the mission-file manager.
Definition ChallengeStatus.m:704
NSString * myName
The player's display name.
Definition ChallengeStatus.h:460
int coinLim
The maximum number of play coins.
Definition ChallengeStatus.h:516
NSString * mySearchID
The player's search identifier.
Definition ChallengeStatus.h:465
ChallengeModeRootView * rootView
The challenge-mode root view.
Definition ChallengeStatus.h:454
NSString * sessionSeed
The current play-session seed.
Definition ChallengeStatus.h:510
double serverTimeDelay
The measured client-to-server clock delay, in seconds.
Definition ChallengeStatus.h:593
BOOL bItemDownload
Whether the mission-reward items have been downloaded.
Definition ChallengeStatus.h:546
NSNumber * scratchID
The current scratch identifier.
Definition ChallengeStatus.h:470
NSString * personalInfoURL
The personal-information URL.
Definition ChallengeStatus.h:583
void missionRewardDownload()
Marks the mission-reward items as downloaded.
Definition ChallengeStatus.m:737
void resetStatus()
Clears the URLs, the initialisation flags, and the line-up image cache, and restores the economy defa...
Definition ChallengeStatus.m:151
NSArray * scratchLineUp
The current scratch line-up: an array of per-tune dictionaries.
Definition ChallengeStatus.h:495
NSArray * stampTable
The stamp table.
Definition ChallengeStatus.h:505
int consumePlayCoin
The play-coin consume cost.
Definition ChallengeStatus.h:551
void saveInformationURL()
Persists the current information URL to NSUserDefaults and clears the in-memory copy.
Definition ChallengeStatus.m:292
void updateScratchItemDir()
Clears the on-disk scratch data when the refresh flag is set, then clears the flag.
Definition ChallengeStatus.m:322
int presentNum
The number of unread presents shown on the menu's badge.
Definition ChallengeStatus.h:541
int coinNum
The number of play coins the player currently holds.
Definition ChallengeStatus.h:521
instancetype init()
Sets the initial economy defaults and computes the phone layout scale.
Definition ChallengeStatus.m:129
int nailNum
The scratch nail count.
Definition ChallengeStatus.h:526
int jCubeNum
The cube count.
Definition ChallengeStatus.h:531
int getSelectedMissionSheetID()
The currently selected mission sheet identifier.
Definition ChallengeStatus.m:732
NSDate * serverDate
The parsed server time.
Definition ChallengeStatus.h:475
NSDate * clientDate
The client time captured alongside the server time.
Definition ChallengeStatus.h:480
NSDate * scratchResetDate
The date the free-scratch allowance next resets.
Definition ChallengeStatus.h:490
int scratchablePanelNum()
The number of scratch panels not yet opened (those whose info entry has no music identifier).
Definition ChallengeStatus.m:625
int consumeScratchCube
The scratch-cube consume cost.
Definition ChallengeStatus.h:556
NSArray * enableMissionSheets
The enabled mission sheets, ordered by identifier.
Definition ChallengeStatus.h:588
void restCoinNum()
Advances the coin count and regeneration date for every fully regenerated coin.
Definition ChallengeStatus.m:452
BOOL bInitialized
Whether the challenge state has been loaded.
Definition ChallengeStatus.h:536
NSArray< ScratchInfo * > * scratchInfoTable
The scratch info table: one ScratchInfo per panel.
Definition ChallengeStatus.h:500
NSString * informationURL
The information URL.
Definition ChallengeStatus.h:578
void createCoinNotification()
Schedules the local notification announcing that play coins have refilled.
Definition ChallengeStatus.m:649
NSDate * coinRestDate
The moment the current coin's regeneration started.
Definition ChallengeStatus.h:485
ChallengeStatus * sharedStatus
The shared instance.
Definition ChallengeStatus.m:116
float phoneScreenRate
The phone's layout scale relative to the pad's.
Definition ChallengeStatus.h:568
int scratchOpenedPanelNum()
The number of scratch panels already opened (those whose info entry has a music identifier).
Definition ChallengeStatus.m:636
int consumeRestCube
The rest-cube consume cost.
Definition ChallengeStatus.h:561
void savePersionalInformationURL()
Persists the current personal-information URL to NSUserDefaults and clears the in-memory copy.
Definition ChallengeStatus.m:313
void clearLineupImage()
Empties the line-up image cache.
Definition ChallengeStatus.m:618
NSString * howtoURL
The how-to URL.
Definition ChallengeStatus.h:573
A scratch track resolved from the challenge line-up, with the player's score, rank,...
Definition ScratchInfo.h:18