Skip to content

Instantly share code, notes, and snippets.

@JamesBender
Created November 11, 2015 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesBender/1ca1f15e6d69f2786ad6 to your computer and use it in GitHub Desktop.
Save JamesBender/1ca1f15e6d69f2786ad6 to your computer and use it in GitHub Desktop.
ICommonGameNetworkControl and supporting classes for TDD-PreCon
using System;
using System.Collections.Generic;
namespace GameNetworkInterfaces
{
public interface ICommonGameNetworkControl
{
Guid Login(string username, string password);
bool Logout(Guid sessionToken);
int PostScoreToLeaderboard(Guid sessionToken, Guid gameToken, int score);
IEnumerable<LeaderBoardEntry> GetLeaderBoard(Guid sessionToken, Guid gameToken, int count);
IEnumerable<Player> GetFriends(Guid sessionToken);
bool AddFriends(Guid sessionToken, Guid playerId);
Guid InviteFriendToMatch(Guid sessionToken, Guid invitedPlayerId, Guid gameToken);
Guid InviteFriendToMatch(Guid sessionToken, Guid invitedPlayerId, Guid gameToken, Guid matchToken);
Guid StartMatch(Guid sessionToken, Guid matchToken);
}
public class LeaderBoardEntry
{
public int Place { get; set; }
public int Score { get; set; }
public string UserName { get; set; }
}
public class Player
{
public Guid Id { get; internal set; }
public string UserName { get; set; }
public string Name { get; set; }
public IList<Guid> FriendIds { get; private set; }
public Player()
{
FriendIds = new List<Guid>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment