Skip to content

Commit

Permalink
reduce the number of objects that are created
Browse files Browse the repository at this point in the history
  • Loading branch information
EinsLucaaa committed Aug 19, 2023
1 parent 2056081 commit fd38f49
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 168 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package top.einsluca.autogg.server;

import java.util.List;

public class ServerConfigurationImpl implements ServerConfiguration {

private final List<String> serverAddress;
private final List<String> format;
private final List<String> filter;

public ServerConfigurationImpl(List<String> addresses, List<String> formats, List<String> filters) {
this.serverAddress = addresses;
this.format = formats;
this.filter = filters;
}

@Override
public List<String> getServerAddress() {
return serverAddress;
}

@Override
public List<String> getFormat() {
return format;
}

@Override
public List<String> getFilter() {
return filter;
}
}
71 changes: 64 additions & 7 deletions core/src/main/java/top/einsluca/autogg/server/ServerRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,70 @@ public class ServerRegistry {
private final List<ServerConfiguration> servers = new ArrayList<>();

public ServerRegistry() {
this.servers.add(new GommeHDConfiguration());
this.servers.add(new NeruxVaceConfiguration());
this.servers.add(new CafeStubeConfiguration());
this.servers.add(new CytooxienConfiguration());
this.servers.add(new AntiACConfiguration());
this.servers.add(new MCCIslandConfiguration());
this.servers.add(new StayMCConfiguration());
this.servers.add(
new ServerConfigurationImpl(
List.of("gommehd.net", "play.gommehd.net", "gommehd.de"),
List.of("-= Statistiken dieser Runde =-", "-= Statistics of this game =-", "hat die PartyGames gewonnen!"),
List.of(":")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("skydinse.de", "play.skindinse.de", "skydinse.tk", "skydinse.net"),
List.of("Statistics of the game:", "Statistiken der Runde:"),
List.of("|")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("cytooxien.de", "cytooxien.net"),
List.of("Statistiken dieser Runde:", "Statistics of the game:"),
List.of("-")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("antiac.net", "antiac.eu", "antiac.de", "antiac.us", "play.antiac.net", "play.antiac.us"),
List.of("Overview of the round", "Rundenübersicht"),
List.of("»")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("neruxvace.de", "neruxvace.net", "nerux.net", "thevace.net", "neruxvase.net", "neruxvase.de"),
List.of("Das Spiel ist beendet!"),
List.of("MVP", "VIP", "PLAYER", "MVP+", ":")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("cafestu.be", "cafestube.eu"),
List.of("has won the game!", "hat das Spiel gewonnen!"),
List.of("●")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("mccisland.net", "play.mccisland.net"),
List.of("Game Over!"),
List.of(":")
)
);

this.servers.add(
new ServerConfigurationImpl(
List.of("staymc.net", "play.staymc.net"),
List.of("hat die Runde gewonnen!"),
List.of(":")
)
);

}

public List<ServerConfiguration> getServers() {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit fd38f49

Please sign in to comment.