|
JubeatPlus 3.9.11
|
Shared state for the challenge mode, including the play-coin economy. More...
#include <ChallengeStatus.h>


Instance Methods | |
| (instancetype) | - init |
| Sets the initial economy defaults and computes the phone layout scale. | |
| (void) | - resetStatus |
| Clears the URLs, the initialisation flags, and the line-up image cache, and restores the economy defaults. | |
| (void) | - initWithDictionary: |
| Builds the whole state from a server-response dictionary, then marks it initialised. | |
| (void) | - updateState: |
| Refreshes the economy, scratch, URL, present, consume, and mission state from a server-response dictionary. | |
| (void) | - updateConsume: |
| Reads the per-action consume costs (play coin, scratch cube, rest cube) from the dictionary when present. | |
| (void) | - updateName: |
| Stores the player's display name. | |
| (void) | - setScratchItem:dict: |
Applies a scratch store dictionary to the info-table entry at the given index (only when the dictionary carries a music_id ). | |
| (void) | - updatePresentNum: |
| Reads the unread-present count from the dictionary when present. | |
| (void) | - setPresentNum: |
| Sets the unread-present count directly. | |
| (void) | - updateScratchID: |
| Reads the scratch identifier, records whether it changed from the persisted one (setting the refresh flag), and stores it. | |
| (void) | - updateHowtoURL: |
| Reads the how-to URL when present. | |
| (void) | - updateInformationURL: |
| Reads the information URL, storing it only when it differs from the persisted one. | |
| (void) | - saveInformationURL |
Persists the current information URL to NSUserDefaults and clears the in-memory copy. | |
| (void) | - updatePersonalInformationURL: |
| Reads the personal-information URL, storing it only when it differs from the persisted one. | |
| (void) | - savePersionalInformationURL |
Persists the current personal-information URL to NSUserDefaults and clears the in-memory copy. | |
| (void) | - updateScratchItemDir |
| Clears the on-disk scratch data when the refresh flag is set, then clears the flag. | |
| (void) | - updateScratchTable: |
Rebuilds the scratch info table (16 panels) from the scratch_panel array, placing each store item at its position . | |
| (void) | - updateScratchLineup: |
Rebuilds the scratch line-up from the music_list array. | |
| (void) | - updateUserInfo: |
| Reads the player's name and search identifier, falling back to the Editor account key when no search identifier is present. | |
| (void) | - updateScratchTimeState: |
Parses the scratch-reset end time (end , JST) into scratchResetDate . | |
| (void) | - updateServerTime: |
Parses the server time (server_time , JST), resets the monthly purchase counters when the month rolled over, records the client time, and computes the server-time delay. | |
| (void) | - updateCubeState: |
Reads the cube count (jCube ) when present. | |
| (void) | - updateCoinState: |
| Reads the coin regeneration time, coin limit, and coin count, then recomputes the coin regeneration start date. | |
| (void) | - updateNailState: |
Reads the scratch nail count (scratch_nail ) when present. | |
| (void) | - restCoinNum |
| Advances the coin count and regeneration date for every fully regenerated coin. | |
| (void) | - updateChallengeMission: |
Rebuilds the enabled mission sheets from the sheet_list dictionary, ordered ascending by numeric sheet identifier. | |
| (void) | - exchangeNail: |
| Applies a nail-exchange response: refreshes the nail and cube counts. | |
| (void) | - openScratch:index: |
| Applies an open-scratch response: refreshes nail and cube counts and stores the panel's store item. | |
| (void) | - restPlayCoin: |
| Applies a rest-play response: refreshes the coin and cube state. | |
| (void) | - changeScratchNail: |
| Applies a change-scratch-nail response: refreshes the nail and cube counts. | |
| (void) | - cubePurchaseSuccess: |
| Applies a cube-purchase-success response: refreshes the cube count. | |
| (void) | - openMusicDetail:index: |
| Applies a music-detail response to the panel's scratch info, then refreshes the server time. | |
| (void) | - playMusic: |
| Stores the session seed and refreshes the coin state. | |
| (void) | - receivePresent: |
| Applies a present-received response: refreshes the coin, cube, and nail counts. | |
| (void) | - updateMusicRanking:diff:rank:index: |
Updates the scratch info entry matching musicID with a fresh rank, then returns. | |
| (nullable NSString *) | - timeStringFromInterval_Minute: |
Renders a second count as "m:ss" , clamping the minutes to 200. | |
| (nullable NSString *) | - timeStringFromInterval: |
Renders a second count as "hh:mm:ss" , clamping the hours to 999. | |
| (double) | - getTimeLeft: |
| Seconds remaining until the given date, corrected by the server-time delay. | |
| (double) | - getMusicEnableTime: |
| Seconds until the given panel's tune stops being playable, or -1 when the panel is closed. | |
| (nullable NSString *) | - getMusicEnableTimeString: |
| The given panel's enabled time as display text. | |
| (void) | - setLineupImage:musicID: |
| Caches a tune's square artwork keyed by its music identifier. | |
| (nullable UIImage *) | - getLineupImage: |
| The cached square artwork for a tune, keyed by its music identifier. | |
| (void) | - clearLineupImage |
| Empties the line-up image cache. | |
| (int) | - scratchablePanelNum |
| The number of scratch panels not yet opened (those whose info entry has no music identifier). | |
| (int) | - scratchOpenedPanelNum |
| The number of scratch panels already opened (those whose info entry has a music identifier). | |
| (void) | - createCoinNotification |
| Schedules the local notification announcing that play coins have refilled. | |
| (void) | - updateMissionSheet: |
Reads the selected sheet identifier (select_sheet_id ), defaulting to 0 when absent. | |
| (nullable ChallengeMissionSheet *) | - getSelectedMissionSheet |
| The currently selected mission sheet, looked up in the mission-file manager. | |
| (void) | - setSelectedMissionSheet: |
| Selects a mission sheet and rebuilds the enabled-sheets list with it re-sorted into place by identifier. | |
| (int) | - getSelectedMissionSheetID |
| The currently selected mission sheet identifier. | |
| (void) | - missionRewardDownload |
| Marks the mission-reward items as downloaded. | |
| (void) | - setChallengeRootView: |
| Stores the challenge-mode root view (weak). | |
Properties | |
| ChallengeStatus * | sharedStatus |
| The shared instance. | |
| ChallengeModeRootView * | rootView |
| The challenge-mode root view. | |
| NSString * | myName |
| The player's display name. | |
| NSString * | mySearchID |
| The player's search identifier. | |
| NSNumber * | scratchID |
| The current scratch identifier. | |
| NSDate * | serverDate |
| The parsed server time. | |
| NSDate * | clientDate |
| The client time captured alongside the server time. | |
| NSDate * | coinRestDate |
| The moment the current coin's regeneration started. | |
| NSDate * | scratchResetDate |
| The date the free-scratch allowance next resets. | |
| NSArray * | scratchLineUp |
| The current scratch line-up: an array of per-tune dictionaries. | |
| NSArray< ScratchInfo * > * | scratchInfoTable |
The scratch info table: one ScratchInfo per panel. | |
| NSArray * | stampTable |
| The stamp table. | |
| NSString * | sessionSeed |
| The current play-session seed. | |
| int | coinLim |
| The maximum number of play coins. | |
| int | coinNum |
| The number of play coins the player currently holds. | |
| int | nailNum |
| The scratch nail count. | |
| int | jCubeNum |
| The cube count. | |
| BOOL | bInitialized |
| Whether the challenge state has been loaded. | |
| int | presentNum |
| The number of unread presents shown on the menu's badge. | |
| BOOL | bItemDownload |
| Whether the mission-reward items have been downloaded. | |
| int | consumePlayCoin |
| The play-coin consume cost. | |
| int | consumeScratchCube |
| The scratch-cube consume cost. | |
| int | consumeRestCube |
| The rest-cube consume cost. | |
| float | phoneScreenRate |
| The phone's layout scale relative to the pad's. | |
| NSString * | howtoURL |
| The how-to URL. | |
| NSString * | informationURL |
| The information URL. | |
| NSString * | personalInfoURL |
| The personal-information URL. | |
| NSArray * | enableMissionSheets |
| The enabled mission sheets, ordered by identifier. | |
| double | serverTimeDelay |
| The measured client-to-server clock delay, in seconds. | |
Shared state for the challenge mode, including the play-coin economy.
| - (void) changeScratchNail: | (nullable NSDictionary *) | dictionary |
Applies a change-scratch-nail response: refreshes the nail and cube counts.
| dictionary | The server-response dictionary. |
| - (void) clearLineupImage |
Empties the line-up image cache.
| - (void) createCoinNotification |
Schedules the local notification announcing that play coins have refilled.
Called from -[JubeatAppDelegate applicationDidEnterBackground:], its only call site. Returns without scheduling when the state is not initialised or when the coin count is not below the limit.
| - (void) cubePurchaseSuccess: | (nullable NSDictionary *) | dictionary |
Applies a cube-purchase-success response: refreshes the cube count.
| dictionary | The server-response dictionary. |
| - (void) exchangeNail: | (nullable NSDictionary *) | dictionary |
Applies a nail-exchange response: refreshes the nail and cube counts.
| dictionary | The server-response dictionary. |
| - (nullable UIImage *) getLineupImage: | (nullable id) | musicID |
The cached square artwork for a tune, keyed by its music identifier.
| musicID | The tune identifier key. |
| - (double) getMusicEnableTime: | (int) | index |
Seconds until the given panel's tune stops being playable, or -1 when the panel is closed.
| index | The scratch panel index. |
| - (NSString *) getMusicEnableTimeString: | (int) | index |
The given panel's enabled time as display text.
| index | The scratch panel index. |
| - (ChallengeMissionSheet *) getSelectedMissionSheet |
The currently selected mission sheet, looked up in the mission-file manager.
| - (int) getSelectedMissionSheetID |
The currently selected mission sheet identifier.
| - (double) getTimeLeft: | (nullable NSDate *) | date |
Seconds remaining until the given date, corrected by the server-time delay.
| date | The target date. |
date , corrected by the server-time delay. | - (instancetype) init |
Sets the initial economy defaults and computes the phone layout scale.
| - (void) initWithDictionary: | (nullable NSDictionary *) | dictionary |
Builds the whole state from a server-response dictionary, then marks it initialised.
| dictionary | The server-response dictionary. |
| - (void) missionRewardDownload |
Marks the mission-reward items as downloaded.
| - (void) openMusicDetail: | (nullable NSDictionary *) | dictionary | |
| index: | (int) | index |
Applies a music-detail response to the panel's scratch info, then refreshes the server time.
| dictionary | The server-response dictionary. |
| index | The scratch panel index. |
| - (void) openScratch: | (nullable NSDictionary *) | dictionary | |
| index: | (int) | index |
Applies an open-scratch response: refreshes nail and cube counts and stores the panel's store item.
| dictionary | The server-response dictionary. |
| index | The scratch panel index. |
| - (void) playMusic: | (nullable NSDictionary *) | dictionary |
Stores the session seed and refreshes the coin state.
| dictionary | The server-response dictionary. |
| - (void) receivePresent: | (nullable NSDictionary *) | dictionary |
Applies a present-received response: refreshes the coin, cube, and nail counts.
| dictionary | The server-response dictionary. |
| - (void) resetStatus |
Clears the URLs, the initialisation flags, and the line-up image cache, and restores the economy defaults.
| - (void) restCoinNum |
Advances the coin count and regeneration date for every fully regenerated coin.
| - (void) restPlayCoin: | (nullable NSDictionary *) | dictionary |
Applies a rest-play response: refreshes the coin and cube state.
| dictionary | The server-response dictionary. |
| - (void) saveInformationURL |
Persists the current information URL to NSUserDefaults and clears the in-memory copy.
| - (void) savePersionalInformationURL |
Persists the current personal-information URL to NSUserDefaults and clears the in-memory copy.
The selector keeps the binary's "Persision" misspelling.
| - (int) scratchablePanelNum |
The number of scratch panels not yet opened (those whose info entry has no music identifier).
| - (int) scratchOpenedPanelNum |
The number of scratch panels already opened (those whose info entry has a music identifier).
| - (void) setChallengeRootView: | (nullable ChallengeModeRootView *) | rootView |
Stores the challenge-mode root view (weak).
| rootView | The root view. |
| - (void) setLineupImage: | (nullable UIImage *) | image | |
| musicID: | (nullable id) | musicID |
Caches a tune's square artwork keyed by its music identifier.
| image | The artwork. |
| musicID | The tune identifier key. |
| - (void) setPresentNum: | (int) | num |
Sets the unread-present count directly.
| num | The new present count. |
| - (void) setScratchItem: | (int) | index | |
| dict: | (nullable NSDictionary *) | dict |
Applies a scratch store dictionary to the info-table entry at the given index (only when the dictionary carries a music_id ).
| index | The scratch panel index. |
| dict | The store dictionary for that panel. |
| - (void) setSelectedMissionSheet: | (nullable ChallengeMissionSheet *) | sheet |
Selects a mission sheet and rebuilds the enabled-sheets list with it re-sorted into place by identifier.
| sheet | The sheet to select. |
| - (NSString *) timeStringFromInterval: | (double) | interval |
Renders a second count as "hh:mm:ss" , clamping the hours to 999.
| interval | The interval in seconds. |
"hh:mm:ss" . | - (NSString *) timeStringFromInterval_Minute: | (double) | interval |
Renders a second count as "m:ss" , clamping the minutes to 200.
| interval | The interval in seconds. |
"m:ss" . | - (void) updateChallengeMission: | (nullable NSDictionary *) | dictionary |
Rebuilds the enabled mission sheets from the sheet_list dictionary, ordered ascending by numeric sheet identifier.
| dictionary | The server-response dictionary. |
| - (void) updateCoinState: | (nullable NSDictionary *) | dictionary |
Reads the coin regeneration time, coin limit, and coin count, then recomputes the coin regeneration start date.
| dictionary | The server-response dictionary. |
| - (void) updateConsume: | (nullable NSDictionary *) | dictionary |
Reads the per-action consume costs (play coin, scratch cube, rest cube) from the dictionary when present.
| dictionary | The server-response dictionary. |
| - (void) updateCubeState: | (nullable NSDictionary *) | dictionary |
Reads the cube count (jCube ) when present.
| dictionary | The server-response dictionary. |
| - (void) updateHowtoURL: | (nullable NSDictionary *) | dictionary |
Reads the how-to URL when present.
| dictionary | The server-response dictionary. |
| - (void) updateInformationURL: | (nullable NSDictionary *) | dictionary |
Reads the information URL, storing it only when it differs from the persisted one.
| dictionary | The server-response dictionary. |
| - (void) updateMissionSheet: | (nullable NSDictionary *) | dictionary |
Reads the selected sheet identifier (select_sheet_id ), defaulting to 0 when absent.
| dictionary | The server-response dictionary. |
| - (void) updateMusicRanking: | (int) | musicID | |
| diff: | (int) | diff | |
| rank: | (int) | rank | |
| index: | (int) | index |
Updates the scratch info entry matching musicID with a fresh rank, then returns.
| musicID | The tune identifier to match. |
| diff | The difficulty index. |
| rank | The new rank. |
| index | The new index. |
| - (void) updateNailState: | (nullable NSDictionary *) | dictionary |
Reads the scratch nail count (scratch_nail ) when present.
| dictionary | The server-response dictionary. |
| - (void) updateName: | (nullable NSString *) | name |
Stores the player's display name.
| name | The new name. |
| - (void) updatePersonalInformationURL: | (nullable NSDictionary *) | dictionary |
Reads the personal-information URL, storing it only when it differs from the persisted one.
| dictionary | The server-response dictionary. |
| - (void) updatePresentNum: | (nullable NSDictionary *) | dictionary |
Reads the unread-present count from the dictionary when present.
| dictionary | The server-response dictionary. |
| - (void) updateScratchID: | (nullable NSDictionary *) | dictionary |
Reads the scratch identifier, records whether it changed from the persisted one (setting the refresh flag), and stores it.
| dictionary | The server-response dictionary. |
| - (void) updateScratchItemDir |
Clears the on-disk scratch data when the refresh flag is set, then clears the flag.
| - (void) updateScratchLineup: | (nullable NSDictionary *) | dictionary |
Rebuilds the scratch line-up from the music_list array.
| dictionary | The server-response dictionary. |
| - (void) updateScratchTable: | (nullable NSDictionary *) | dictionary |
Rebuilds the scratch info table (16 panels) from the scratch_panel array, placing each store item at its position .
| dictionary | The server-response dictionary. |
| - (void) updateScratchTimeState: | (nullable NSDictionary *) | dictionary |
Parses the scratch-reset end time (end , JST) into scratchResetDate .
| dictionary | The server-response dictionary. |
| - (void) updateServerTime: | (nullable NSDictionary *) | dictionary |
Parses the server time (server_time , JST), resets the monthly purchase counters when the month rolled over, records the client time, and computes the server-time delay.
| dictionary | The server-response dictionary. |
| - (void) updateState: | (nullable NSDictionary *) | dictionary |
Refreshes the economy, scratch, URL, present, consume, and mission state from a server-response dictionary.
Unlike -initWithDictionary: it does not touch the user info, scratch identifier, server time, scratch time, or the initialised flag.
| dictionary | The server-response dictionary. |
| - (void) updateUserInfo: | (nullable NSDictionary *) | dictionary |
Reads the player's name and search identifier, falling back to the Editor account key when no search identifier is present.
| dictionary | The server-response dictionary. |
|
readnonatomicassign |
Whether the challenge state has been loaded.
Backed by _bInitialized .
|
readnonatomicassign |
Whether the mission-reward items have been downloaded.
Backed by _bItemDownload .
|
readwritenonatomicstrong |
The client time captured alongside the server time.
|
readwritenonatomicassign |
The maximum number of play coins.
Backed by _coinLim .
|
readwritenonatomicassign |
The number of play coins the player currently holds.
Backed by _coinNum .
|
readwritenonatomicstrong |
The moment the current coin's regeneration started.
|
readwritenonatomicassign |
The play-coin consume cost.
|
readwritenonatomicassign |
The rest-cube consume cost.
|
readwritenonatomicassign |
The scratch-cube consume cost.
|
readnonatomicstrong |
The enabled mission sheets, ordered by identifier.
|
readwritenonatomicstrong |
The how-to URL.
|
readwritenonatomicstrong |
The information URL.
|
readwritenonatomicassign |
The cube count.
|
readwritenonatomicstrong |
The player's display name.
|
readwritenonatomicstrong |
The player's search identifier.
|
readwritenonatomicassign |
The scratch nail count.
|
readnonatomicstrong |
The personal-information URL.
|
readnonatomicassign |
The phone's layout scale relative to the pad's.
Single precision, per the f encoding.
Views that lay out in pad coordinates multiply by this on the phone and by nothing on the pad.
|
readnonatomicassign |
The number of unread presents shown on the menu's badge.
Backed by _presentNum .
|
readnonatomicweak |
The challenge-mode root view.
Weak, per the R,W metadata; stored by -setChallengeRootView: rather than a synthesised setter.
|
readnonatomicstrong |
The current scratch identifier.
|
readwritenonatomicstrong |
The scratch info table: one ScratchInfo per panel.
|
readwritenonatomicstrong |
The current scratch line-up: an array of per-tune dictionaries.
|
readwritenonatomicstrong |
The date the free-scratch allowance next resets.
|
readwritenonatomicstrong |
The parsed server time.
|
readwritenonatomicassign |
The measured client-to-server clock delay, in seconds.
|
readwritenonatomicstrong |
The current play-session seed.
|
readnonatomicassign |
The shared instance.
The selector is sharedStatus rather than the sharedManager this binary uses elsewhere. Guarded with dispatch_once .
|
readnonatomicstrong |
The stamp table.