2023-06-06 17:38:31 -04:00
|
|
|
package funkin.play;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Manages playback of multiple songs in a row.
|
2023-07-13 01:13:26 -04:00
|
|
|
*
|
2023-06-06 17:38:31 -04:00
|
|
|
* TODO: Add getters/setters for all these properties to validate them.
|
|
|
|
*/
|
2024-03-16 00:55:57 -04:00
|
|
|
@:nullSafety
|
2023-06-06 17:38:31 -04:00
|
|
|
class PlayStatePlaylist
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Whether the game is currently in Story Mode. If false, we are in Free Play Mode.
|
|
|
|
*/
|
2024-03-16 00:55:57 -04:00
|
|
|
public static var isStoryMode:Bool = false;
|
2023-06-06 17:38:31 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The loist of upcoming songs to be played.
|
|
|
|
* When the user completes a song in Story Mode, the first entry in this list is played.
|
|
|
|
* When this list is empty, move to the Results screen instead.
|
|
|
|
*/
|
|
|
|
public static var playlistSongIds:Array<String> = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The cumulative score for all the songs in the playlist.
|
|
|
|
*/
|
|
|
|
public static var campaignScore:Int = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The title of this playlist, for example `Week 4` or `Weekend 1`
|
|
|
|
*/
|
|
|
|
public static var campaignTitle:String = 'UNKNOWN';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The internal ID of the current playlist, for example `week4` or `weekend-1`.
|
2024-03-16 00:55:57 -04:00
|
|
|
* @default `null`, used when no playlist is loaded
|
2023-06-06 17:38:31 -04:00
|
|
|
*/
|
2024-03-16 00:55:57 -04:00
|
|
|
public static var campaignId:Null<String> = null;
|
2023-06-06 17:38:31 -04:00
|
|
|
|
2023-10-11 17:33:55 -04:00
|
|
|
public static var campaignDifficulty:String = Constants.DEFAULT_DIFFICULTY;
|
2023-06-06 17:38:31 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resets the playlist to its default state.
|
|
|
|
*/
|
|
|
|
public static function reset():Void
|
|
|
|
{
|
|
|
|
isStoryMode = false;
|
|
|
|
playlistSongIds = [];
|
|
|
|
campaignScore = 0;
|
|
|
|
campaignTitle = 'UNKNOWN';
|
2024-03-16 00:55:57 -04:00
|
|
|
campaignId = null;
|
2023-10-11 17:33:55 -04:00
|
|
|
campaignDifficulty = Constants.DEFAULT_DIFFICULTY;
|
2023-06-06 17:38:31 -04:00
|
|
|
}
|
|
|
|
}
|