mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
make countdown code a bit nicer
This commit is contained in:
parent
0a8331f545
commit
992635d24b
@ -80,14 +80,12 @@ namespace MCGalaxy.Games {
|
||||
return pl.ColoredName + suffix;
|
||||
}
|
||||
|
||||
public override void Start(Player p, string map, int rounds) {
|
||||
map = "countdown";
|
||||
if (!LevelInfo.MapExists(map)) {
|
||||
p.Message("Countdown level not found, generating..");
|
||||
GenerateMap(p, 32, 32, 32);
|
||||
}
|
||||
|
||||
base.Start(p, map, rounds);
|
||||
protected override string GetStartMap(Player p, string forcedMap) {
|
||||
if (!LevelInfo.MapExists("countdown")) {
|
||||
p.Message("Countdown level not found, generating..");
|
||||
GenerateMap(p, 32, 32, 32);
|
||||
}
|
||||
return "countdown";
|
||||
}
|
||||
|
||||
protected override void StartGame() {
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Games {
|
||||
|
||||
protected abstract void StartGame();
|
||||
public virtual void Start(Player p, string map, int rounds) {
|
||||
map = GetStartMap(this, map);
|
||||
map = GetStartMap(p, map);
|
||||
if (map == null) {
|
||||
p.Message("No maps have been setup for {0} yet", GameName); return;
|
||||
}
|
||||
@ -78,9 +78,9 @@ namespace MCGalaxy.Games {
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual string GetStartMap(RoundsGame game, string forcedMap) {
|
||||
protected virtual string GetStartMap(Player p, string forcedMap) {
|
||||
if (forcedMap.Length > 0) return forcedMap;
|
||||
List<string> maps = Picker.GetCandidateMaps(game);
|
||||
List<string> maps = Picker.GetCandidateMaps(this);
|
||||
|
||||
if (maps == null || maps.Count == 0) return null;
|
||||
return LevelPicker.GetRandomMap(new Random(), maps);
|
||||
|
Loading…
x
Reference in New Issue
Block a user