#1. I'm thinking of creating a web service which contain a list object which contain a number of entrys of the own-defined class Match, which will have the variables:
MapID (int)
Number of players (int)
SkillLevel (enum)
ServerIsOn (bool)
In a Windows application you can either choose to search for matches or create a match which will be searchable to others. If you choose to create a match, a new instance of the Match object is created with the settings you specify and then added to the list on the web service.If you choose to search for matches instead, you retrieve the list and filter it (see question #2), and retrieve the list from the server again every 10 seconds or when the user self press an Update-button. Now, to my question:
How do I create a web service for this?
Can you show me some examples? I'd be grateful if you also showed me some example methods for the application as well.
#2. When you've retrieved the list from the server, you want to filter it to only show the results you want to see. How do you do that? Like this?
Expand|Select|Wrap|Line Numbers
- private void filter()
- {
- foreach (Match m in retrievedList)
- {
- if (m.MapID == map && m.NumberOfPlayers == nrOfPlayers && m.SkillLevel == skill && m.ServerIsOn == serverOn)
- {
- filteredList.Add(m);
- }
- }
- // methods for displaying the filtered list in the application
- ...
- }
Oh, and sorry for my English and for a messy post :P