this is more of a general question and I would hope that you can give me some best-practice or refer me to a good page with this kind of information.
I'm working on a poker client right now and when the server is being started it should create X tables so that the Lobby (for the user) is not empty so when the program starts on the server it creates 6 tables which can be found in the lobby however how should the user access the right table?
All tables have an unique ID but I'm having problem what is a good approach here.
Thanks in advance,
Tomas

Tomas Westerlund26 pointsPosted Jun 24, 2013, 1:51 AM EDT
When the program is being Initialized it runs this method:
DataTable allTables = sql.RetrieveAllTables(); for (int i = 0; i < allTables.Rows.Count; i++) { DataRow row = allTables.Rows[i]; int tableID = Convert.ToInt32(row["TableID"]); Classes.Gameplay.Table temp = new Classes.Gameplay.Table(tableID); tables.Add(tableID, temp); }It is far from completed but the idea is that I will always have atleast two tables of each poker form (Texas and Omaha for example) and for each stake (10/20 and 25/50 for example) that will be created when the server (the program) is restarted.
The tables are being loaded into the lobby and when I double click one table this code is being runned and opens up the table:
Do you think this is a good approach?
Best regards,
Tomas