SteamWar/BauSystem2.0
Archiviert
12
0

Expanded Command with delete option
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
D4rkr34lm 2024-03-12 20:31:20 +01:00
Ursprung dfd20f03b6
Commit 8a3d8a9c33
2 geänderte Dateien mit 14 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -78,7 +78,18 @@ public class TraceCommand extends SWCommand {
BauSystem.MESSAGE.send("TRACE_MESSAGE_HIDE", player);
}
@Register(value = "delete", description = "TRACE_COMMAND_HELP_SHOW")
public void delete(Player player){
manager.clear();
//BauSystem.MESSAGE.send("TRACE_MESSAGE_DELETE_ALL", player);
}
//TODO Manage non exsistent trace
@Register(value = "delete", description = "TRACE_COMMAND_HELP_SHOW")
public void delete(Player player, int id){
manager.remove(id);
//BauSystem.MESSAGE.send("TRACE_MESSAGE_DELETE", player);
}
@ClassMapper(value = BundleFilter.class, local = true)
public TypeMapper<BundleFilter> bundleFilterClassMapper() {
@ -100,8 +111,6 @@ public class TraceCommand extends SWCommand {
return Arrays.stream(BundleFilter.values())
.map(Enum::toString)
.collect(Collectors.toList());
}
};
}

Datei anzeigen

@ -70,10 +70,12 @@ public class TraceManager implements Listener {
*
* @param id id of the trace to be removed
*/
public void remove(int id){
public boolean remove(int id){
if(id >= nextOpenId) return false;
for(Player player: viewFlagMap.keySet())
traces.get(id).hide(player);
traces.remove(id);
return true;
}
/** Clears all traces