当前位置: 首页>>代码示例>>C#>>正文


C# GameStatus.ToString方法代码示例

本文整理汇总了C#中GameStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GameStatus.ToString方法的具体用法?C# GameStatus.ToString怎么用?C# GameStatus.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameStatus的用法示例。


在下文中一共展示了GameStatus.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateGame

 public Game CreateGame(string userId, GameStatus status, bool isActive, List<string> tiles, List<string> gameTiles)
 {
     var user = new User(userId);
     var game = new Article(Schemas.Game);
     game.Set("status", status.ToString());
     game.Set("tiles", string.Join(",", gameTiles));
     var conn = Connection.New(Relations.GamePlayer)
         .FromExistingArticle("player", userId)
         .ToNewArticle("game", game);
     conn.Set("ishost", true);
     conn.Set("isactive", isActive);
     conn.Set("tiles", string.Join("|", tiles));
     conn.Set("tiles_remaining", AppConfigurations.MaxTilesPerPlayer);
     conn.SaveAsync().Wait();
     return game.ToModelGame();
 }
开发者ID:TokleMahesh,项目名称:GOB,代码行数:16,代码来源:GameDataProvider.cs

示例2: SaveGameStatus

 public bool SaveGameStatus(string gameId, GameStatus status)
 {
     var game = GetGame(gameId);
     if (game != null)
     {
         game.Status = status.ToString();
     }
     return _gameDataProvider.SaveGameStatus(gameId, status);
 }
开发者ID:TokleMahesh,项目名称:GOB,代码行数:9,代码来源:GameProvider.cs

示例3: SaveGameStatus

 public bool SaveGameStatus(string gameId, GameStatus status)
 {
     var article = Articles.GetAsync(Schemas.Game, gameId, new[] {"status"}).Result;
     if (!string.Equals(GameStatus.Finished.ToString(), article.Get<string>("status"), StringComparison.OrdinalIgnoreCase))
     {
         var game = new Article(Schemas.Game, gameId);
         game.Set("status", status.ToString());
         game.SaveAsync().Wait();
     }
     return true;
 }
开发者ID:TokleMahesh,项目名称:GOB,代码行数:11,代码来源:GameDataProvider.cs

示例4: StartGame

 public bool StartGame(string gameId, string userId, GameStatus status, bool isActive, List<string> tiles, List<string> gameTiles)
 {
     var game = new Article(Schemas.Game, gameId);
     var players = game.GetAllConnectedArticles(Relations.GamePlayer, null, null, new[] {"__id"});
     if (players != null && players.Count == 1)
     {
         game.Set("status", status.ToString());
         game.Set("tiles", string.Join(",", gameTiles));
         var conn = Connection.New(Relations.GamePlayer)
             .FromExistingArticle("player", userId)
             .ToExistingArticle("game", gameId);
         conn.Set("ishost", false);
         conn.Set("isactive", isActive);
         conn.Set("tiles", string.Join("|", tiles));
         conn.Set("tiles_remaining", AppConfigurations.MaxTilesPerPlayer);
         conn.SaveAsync().Wait();
         game.SaveAsync().Wait();
         return true;
     }
     return false;
 }
开发者ID:TokleMahesh,项目名称:GOB,代码行数:21,代码来源:GameDataProvider.cs

示例5: SetState

        public void SetState( GameStatus status )
        {
            #if DEBUG
            if ( status != _status )
            #endif

            {
                Debug.Log("new status == " + status.ToString());
                oldStatus = _status;
                _status = status;
                if (oldStatus == GameStatus.Win && status == GameStatus.PlayingAdvertisement)
                {
                    OnStatusChanged(status, oldStatus);
                }
                else if (status == GameStatus.WinCompleted && oldStatus == GameStatus.PlayingAdvertisement)
                {
                    Debug.Assert(false, "this should not happen");
                    //ignore... we are playing ad.. fire WinCompleted when ad is completed
                }
                else
                    OnStatusChanged(status, oldStatus);
            }
        }
开发者ID:jaimerodriguez,项目名称:chomp,代码行数:23,代码来源:GameState.cs


注:本文中的GameStatus.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。