namespace WebEMSim { public class Storage { public static Storage Shared = new Storage(); private Dictionary tournamentStore = new Dictionary(); public Tournament? CreateTournament() { Tournament tournament = new(); string id = tournament.ID; bool success = tournamentStore.TryAdd(id, tournament); if (!success) return null; return tournament; } public Tournament? GetTournament(string id) { Tournament? tournament = null; bool success = tournamentStore.TryGetValue(id, out tournament); if(!success) return null; return tournament; } public List ListTournaments() { return [.. tournamentStore.Keys]; } public bool? DeleteTournament(string id) { Tournament? tournament = null; bool found = tournamentStore.TryGetValue(id, out tournament); if (!found) return null; return tournamentStore.Remove(id); } } }