mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 10:16:04 +00:00
update win modal to link to patreon, create game mode rotation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { GameMapType } from "../core/game/Game";
|
||||
import { GameMapType, GameMode } from "../core/game/Game";
|
||||
import { PseudoRandom } from "../core/PseudoRandom";
|
||||
|
||||
enum PlaylistType {
|
||||
@@ -9,6 +9,9 @@ enum PlaylistType {
|
||||
const random = new PseudoRandom(123);
|
||||
|
||||
export class MapPlaylist {
|
||||
private gameModeRotation = [GameMode.FFA, GameMode.FFA, GameMode.Team];
|
||||
private currentGameModeIndex = 0;
|
||||
|
||||
private mapsPlaylistBig: GameMapType[] = [];
|
||||
private mapsPlaylistSmall: GameMapType[] = [];
|
||||
private currentPlaylistCounter = 0;
|
||||
@@ -20,6 +23,13 @@ export class MapPlaylist {
|
||||
return mapsPlaylist.shift()!;
|
||||
}
|
||||
|
||||
public getNextGameMode(): GameMode {
|
||||
const nextGameMode = this.gameModeRotation[this.currentGameModeIndex];
|
||||
this.currentGameModeIndex =
|
||||
(this.currentGameModeIndex + 1) % this.gameModeRotation.length;
|
||||
return nextGameMode;
|
||||
}
|
||||
|
||||
private getNextMapsPlayList(playlistType: PlaylistType): GameMapType[] {
|
||||
switch (playlistType) {
|
||||
case PlaylistType.BigMaps:
|
||||
|
||||
Reference in New Issue
Block a user