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


C# Game.ToString方法代码示例

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


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

示例1: HandleGameStateChange

	private void HandleGameStateChange(Game.GameStateId newState) {
		this.GameStateAnimator.SetTrigger( newState.ToString() );
		foreach(var playerUI in this.PlayerUIs) {
			if(playerUI != null) {
				playerUI.GoToGameState( newState );
			}
		}
		
		if(newState == Game.GameStateId.WaitingForPlayers) {
			Game.Instance.EventPlayerCanJoinChanged += Instance_EventPlayerCanJoinChanged;
			Game.Instance.EventPlayerReadyChanged += Instance_EventPlayerReadyChanged;
			for (int i = 0; i < 4; i++) {
				Instance_EventPlayerCanJoinChanged( i, Game.Instance.CanPlayerJoin( i ) );
			}
		}
		else {
			Game.Instance.EventPlayerReadyChanged -= Instance_EventPlayerReadyChanged;
			Game.Instance.EventPlayerCanJoinChanged -= Instance_EventPlayerCanJoinChanged;
		}

		if (newState == Game.GameStateId.Playing) {
			Game.Instance.EventPlayerScored += Instance_EventPlayerScored;
			Game.Instance.EventPlayerKilledMinion += Instance_EventPlayerKilledMinion;
			for(int i = 0; i < 4; i++) {
				if(this.PlayerUIs[i] != null) {
					this.PlayerUIs[i].ShowCombo( 0 );
				}
			}
		}
		else {
			Game.Instance.EventPlayerScored -= Instance_EventPlayerScored;
			Game.Instance.EventPlayerKilledMinion -= Instance_EventPlayerKilledMinion;
		}
	}
开发者ID:marcelschmidt1337,项目名称:ggj2016,代码行数:34,代码来源:IngameUI.cs

示例2: PerformOneGame

        private static void PerformOneGame(IBlackjackTable table)
        {
            var game = new Game(table);

            System.Console.WriteLine();
            System.Console.WriteLine("***************************");
            System.Console.WriteLine("******   NEW ROUND   ******");
            System.Console.WriteLine("***************************");
            System.Console.WriteLine();

            game.StartNewGame();
            game.CallForBets();
            game.DealHands();

            System.Console.WriteLine("***   Initial Deal   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.OfferSplits();

            System.Console.WriteLine("***   After OfferSplits   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.OfferDoubleDowns();

            System.Console.WriteLine("***   After OfferDoubleDowns   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.FillPlayerHands();

            System.Console.WriteLine("***   After FillPlayerHands   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.FillDealerHand();

            System.Console.WriteLine("***   After FillDealerHands   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            var amount = game.SettleBets();
            var winnings = string.Format("House Winnings: {0:C}", amount);

            System.Console.WriteLine("***   After SettleBets   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());
            System.Console.WriteLine(winnings);

            System.Console.ReadLine();
        }
开发者ID:gjamesbaker,项目名称:BJB,代码行数:52,代码来源:Program.cs

示例3: GetGameCaption

 private string GetGameCaption(Game game)
 {
     return game.ToString().Replace("_", " ");
 }
开发者ID:exelv1,项目名称:SteamServerBrowser,代码行数:4,代码来源:ServerBrowserForm.cs

示例4: JobTypeToString

 public static string JobTypeToString(Game.JobType type)
 {
     switch (type)
     {
         case Game.JobType.BuildWall:
         case Game.JobType.BuildFloor:
         case Game.JobType.BuildStairsUp:
         case Game.JobType.BuildStairsDown:
         case Game.JobType.BuildRampUp:
         case Game.JobType.BuildRampDown:
         case Game.JobType.BuildDoor:
         case Game.JobType.BuildWell:
         case Game.JobType.BuildConstruction:
         case Game.JobType.BuildWorkshop:
         case Game.JobType.BuildMechanism:
         case Game.JobType.BuildContainer:
         case Game.JobType.BuildFurniture:
         case Game.JobType.BuildContainers:
         case Game.JobType.BuildWorkshops:
         case Game.JobType.BuildMechanisms:
         case Game.JobType.BuildInclineUp:
         case Game.JobType.BuildInclineDown:
             return "Build";
         case Game.JobType.PlantTree:
         case Game.JobType.PlantSeed:
             return "Plant";
         case Game.JobType.ReplaceWall:
         case Game.JobType.ReplaceFloor:
             return "Replace";
         default:
             return type.ToString();
     }
 }
开发者ID:Gnomodia,项目名称:Gnomodia,代码行数:33,代码来源:Rightclick_Rebuild.cs

示例5: On_TileSelectionManager_SetMouseAction

 public static void On_TileSelectionManager_SetMouseAction(Game.GUI.TileSelectionManager self, Game.JobType job, Game.JobData data, bool multiselect, bool rotatable, bool groundSelect, bool snapToGround)
 {
     initiatingJob = new JobConfiguration()
     {
         Type = job,
         Data = data,
         MultiSelect = multiselect,
         Rotatable = rotatable,
         GroundSelect = groundSelect,
         SnapToGround = snapToGround
     };
     if (data != null)
     {
         data.ToString();
         return;
     }
 }
开发者ID:Gnomodia,项目名称:Gnomodia,代码行数:17,代码来源:Rightclick_Rebuild.cs

示例6: GameInfo

        internal GameInfo(Game game, string languageId)
        {
            this.Game = game;

            this.LanguageId = languageId;

            switch (game)
            {
                case Game.GH3_Wii:
                    FileExtension = "ngc";
                    HasQbPab = false;
                    MidTextInQbPak = false;
                    GuitarProgressionQbFilename = string.Format(@"cripts\guitar\guitar_progression.qb.{0}", FileExtension);
                    GuitarCoOpQbFilename = string.Format(@"cripts\guitar\guitar_coop.qb.{0}", FileExtension);
                    SonglistQbFilename = string.Format(@"cripts\guitar\songlist.qb.{0}", FileExtension);
                    StoreDataQbFilename = string.Format(@"cripts\guitar\store_data.qb.{0}", FileExtension);
                    this.PakFormatType = PakFormatType.Wii;
                    StreamDat = string.Format(@"streams/streamall.dat.{0}", FileExtension);
                    StreamWad = string.Format(@"streams/streamall.wad.{0}", FileExtension);
                    QbPakFilename = string.Format(@"pak/qb{0}.pak.{1}", languageId, FileExtension);
                    QbPabFilename = string.Empty;
                    DbgPakFilename = string.Format(@"pak/dbg.pak.{0}", FileExtension);
                    break;
                case Game.GHA_Wii:
                    FileExtension = "ngc";
                    HasQbPab = false;
                    MidTextInQbPak = true;
                    GuitarProgressionQbFilename = string.Format(@"scripts\guitar\guitar_progression.qb.{0}", FileExtension);
                    GuitarCoOpQbFilename = string.Format(@"scripts\guitar\guitar_coop.qb.{0}", FileExtension);
                    SonglistQbFilename = string.Format(@"scripts\guitar\songlist.qb.{0}", FileExtension);
                    StoreDataQbFilename = string.Format(@"scripts\guitar\store_data.qb.{0}", FileExtension);
                    this.PakFormatType = PakFormatType.Wii;
                    StreamDat = string.Format(@"streams/streamall.dat.{0}", FileExtension);
                    StreamWad = string.Format(@"streams/streamall.wad.{0}", FileExtension);
                    QbPakFilename = string.Format(@"pak/qb{0}.pak.{1}", languageId, FileExtension);
                    QbPabFilename = string.Empty;
                    DbgPakFilename = string.Format(@"pak/dbg.pak.{0}", FileExtension);
                    break;
                case Game.GH3_PS2: //FILLER VALUES
                    FileExtension = "ps2";
                    HasQbPab = true;
                    MidTextInQbPak = true;
                    GuitarProgressionQbFilename = string.Format(@"scripts\guitar\guitar_progression.qb.{0}", FileExtension);
                    GuitarCoOpQbFilename = string.Format(@"scripts\guitar\guitar_coop.qb.{0}", FileExtension);
                    SonglistQbFilename = string.Format(@"scripts\guitar\songlist.qb.{0}", FileExtension);
                    StoreDataQbFilename = string.Format(@"scripts\guitar\store_data.qb.{0}", FileExtension);
                    this.PakFormatType = PakFormatType.PS2;
                    StreamDat = string.Format(@"streams/streamall.dat.{0}", FileExtension);
                    StreamWad = string.Format(@"streams/streamall.wad.qb.{0}", FileExtension);
                    QbPakFilename = string.Format(@"pak\qb{0}.pak.{1}", languageId, FileExtension);
                    QbPabFilename = string.Empty;
                    DbgPakFilename = string.Format(@"pak\dbg.pak.{0}", FileExtension);
                    break;
                case Game.GH3_1_3_PC: //FILLER VALUES
                    FileExtension = "xen";
                    HasQbPab = true;
                    MidTextInQbPak = true;
                    GuitarProgressionQbFilename = string.Format(@"scripts\guitar\guitar_progression.qb.{0}", FileExtension);
                    GuitarCoOpQbFilename = string.Format(@"scripts\guitar\guitar_coop.qb.{0}", FileExtension);
                    SonglistQbFilename = string.Format(@"scripts\guitar\songlist.qb.{0}", FileExtension);
                    StoreDataQbFilename = string.Format(@"scripts\guitar\store_data.qb.{0}", FileExtension);
                    this.PakFormatType = PakFormatType.PC;
                    StreamDat = string.Format(@"streams/streamall.dat.{0}", FileExtension);
                    StreamWad = string.Format(@"streams/streamall.wad.qb.{0}", FileExtension);
                    QbPakFilename = string.Format(@"pak\qb{0}.pak.{1}", languageId, FileExtension);
                    QbPabFilename = string.Empty;
                    DbgPakFilename = string.Format(@"pak\dbg.pak.{0}", FileExtension);
                    break;
                default:
                    throw new ApplicationException(string.Format("'{0}' is not a known Game type", game.ToString()));
            }
        }
开发者ID:Nanook,项目名称:TheGHOST,代码行数:72,代码来源:GameInfo.cs

示例7: GameEnumToString

 public static string GameEnumToString(Game game)
 {
     if (_games.ContainsKey(game))
         return _games[game];
     else
         throw new ApplicationException(string.Format("'{0}' is not a known Game type", game.ToString()));
 }
开发者ID:Nanook,项目名称:TheGHOST,代码行数:7,代码来源:GameInfo.cs

示例8: GoToGameState

	public void GoToGameState(Game.GameStateId gameState) {
		this.GameStateAnimator.SetTrigger( gameState.ToString() );
	}
开发者ID:marcelschmidt1337,项目名称:ggj2016,代码行数:3,代码来源:PlayerUI.cs


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