示例#1
0
        public static HostedGameSASModel ToHostedGameSasModel(
            this HostedGameSASRequest request, Uri host)
        {
            var ret = new HostedGameSASModel
            {
                GameId        = request.GameId,
                GameName      = request.GameName,
                GameVersion   = request.GameVersion,
                HasPassword   = request.HasPassword,
                HostUserName  = request.HostUserName,
                Id            = request.Id,
                Name          = request.Name,
                Password      = request.Password,
                HostUri       = host,
                TwoSidedTable = request.TwoSidedTable
            };

            return(ret);
        }
示例#2
0
        public static IHostedGameState ToHostedGameState(this HostedGameSASModel model, EnumHostedGameStatus status = EnumHostedGameStatus.Unknown)
        {
            var ret = new HostedGameState
            {
                GameId            = model.GameId,
                GameName          = model.GameName,
                GameVersion       = model.GameVersion,
                HasPassword       = model.HasPassword,
                HostUserName      = model.HostUserName,
                Id                = model.Id,
                Name              = model.Name,
                Password          = model.Password,
                HostUri           = model.HostUri,
                Status            = status,
                TwoSidedTable     = model.TwoSidedTable,
                CurrentTurnPlayer = 0,
                Players           = new List <HostedGamePlayer>()
            };

            return(ret);
        }
示例#3
0
        public static HostedGameSASModel ToHostedGameSasModel(
            this HostedGameSASRequest request, Uri host)
        {
            var ret = new HostedGameSASModel
                          {
                              GameId = request.GameId,
                              GameName = request.GameName,
                              GameVersion = request.GameVersion,
                              HasPassword = request.HasPassword,
                              HostUserName = request.HostUserName,
                              Id = request.Id,
                              Name = request.Name,
                              Password = request.Password,
                              HostUri = host,
                              TwoSidedTable = request.TwoSidedTable,
                              Spectators = request.Spectators,
							  HostUserIconUrl = request.HostUserIconUrl,
							  GameIconUrl = request.GameIconUrl
                          };
            return ret;
        }