-
Notifications
You must be signed in to change notification settings - Fork 1
/
ScoreBoardService.svc.cs
46 lines (42 loc) · 1.33 KB
/
ScoreBoardService.svc.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
namespace ScoreBoardService
{
public class ScoreBoardService : IScoreBoardService1
{
public ScoreBoardVersion ServiceVersion()
{
return new ScoreBoardVersion { Version = 1 };
}
public GameId GameId(string game, int version)
{
return new GameId { GameName = game, VersionId = version };
}
public void SubmitScore(ScoreBoardVersion version, GameId gameid, string username, int score)
{
switch (version.Version)
{
case 1:
ScoreDataStoreFactory.GetDataStore().AddGameScore(gameid, username, score);
break;
default:
throw new NotImplementedException();
}
}
public IEnumerable<Tuple<string, int>> RetrieveScores(ScoreBoardVersion version, GameId gameid)
{
switch (version.Version)
{
case 1:
return ScoreDataStoreFactory.GetDataStore().GetGameScores(gameid);
default:
throw new NotImplementedException();
}
}
}
}