本文整理汇总了C#中Player.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Player.ToString方法的具体用法?C# Player.ToString怎么用?C# Player.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestToString
public void TestToString()
{
Player player = new Player("player", 10);
string expected = " 10 | player";
string result = player.ToString();
Assert.AreEqual(expected, result);
}
示例2: firePlayerRejected
private void firePlayerRejected(Player player)
{
if (PlayerRejected != null)
{
PlayerRejected(player);
}
Debug.Singleton.sendDebugMessage(DEBUGLEVELS.WARNING, String.Format(MSG_REJECTED, player.ToString()));
}
示例3: CmdAdd
void CmdAdd(bool host) {
GameInputManager i = FindObjectOfType<GameInputManager> ();
isHost = i.isHost;
g_fighter = (GameObject)Instantiate (Mario);
//g_fighter = (GameObject)Instantiate (Inkachu);
fighter = g_fighter.GetComponent<Fighter> ();
player = PlayerContainer.Add (fighter);
FindObjectOfType<ResultContainer> ().Add (player);
this.gameObject.name = player.ToString ();
fighter.SetPlayer (player);
fighter.setName (player.ToString ());
fighter.SetInput (this);
fighter.SetLocalClient (isHost);
NetworkServer.Spawn (g_fighter);
Debug.Log (PlayerContainer.Get(player).getName() + " joined the game");
RpcAdd (player);
}
示例4: firePlayerCalledBingo
private void firePlayerCalledBingo(Player player)
{
if (PlayerCalledBingo != null)
{
PlayerCalledBingo.Invoke(player);
}
Debug.Singleton.sendDebugMessage(DEBUGLEVELS.INFO, String.Format(MSG_BINGO, player.ToString()));
}
示例5: firePlayerCodeRejected
private void firePlayerCodeRejected(Player player,string code)
{
if (PlayerCodeRejected != null)
{
PlayerCodeRejected.Invoke(player);
}
Debug.Singleton.sendDebugMessage(DEBUGLEVELS.INFO, String.Format(MSG_CODE_REJECTED, code, player.ToString()));
}
示例6: firePlayerOped
private void firePlayerOped(Player player)
{
if (PlayerOped != null)
{
PlayerOped.Invoke(player);
}
Debug.Singleton.sendDebugMessage(DEBUGLEVELS.INFO, String.Format(MSG_OP, player.ToString()));
}
示例7: fireImageUpdated
private void fireImageUpdated(Player player)
{
if (ImageUpdated != null)
{
ImageUpdated.Invoke(player);
}
Debug.Singleton.sendDebugMessage(DEBUGLEVELS.INFO, String.Format(MSG_IMAGE, player.ToString()));
}
示例8: GetUserIdFromRole
public int GetUserIdFromRole( Player.CharacterClass role) {
foreach(PlayerData data in players) {
if (data.type == Player.GetCharacterClassName(role)) {
return data.user_id;
}
}
Debug.LogWarning(string.Format("User with class `{0}' does not exist in world `{1}'.",role.ToString(),GameManager.worldData.id));
return -1;
}
示例9: DetailsCommand
public DetailsCommand(DetailsDisplayEnum display, Player player, VillageTools tool)
{
Tooltip = player.ToString();
Display = display;
if (Display == DetailsDisplayEnum.None || Display == DetailsDisplayEnum.Village) Display = DetailsDisplayEnum.Player;
else if (Display == DetailsDisplayEnum.Tribe && !player.HasTribe) Display = DetailsDisplayEnum.Player;
UnderlyingDisplay = DetailsDisplayEnum.Player;
Player = player;
Tool = tool;
Tribe = player.Tribe;
}
示例10: SpawnPlayer
void SpawnPlayer(Player player)
{
string tempPlayerString = player.ToString ();
int playerNumber = 0;
if (int.TryParse (tempPlayerString, out playerNumber)) {
Transform newPlayerTransform = (Transform)Network.Instantiate(playerPrefab,
transform.position + new Vector3(0, 10, 0),
transform.rotation, playerNumber);
playerList.Add (newPlayerTransform.GetComponent ("Player"));
NetworkView theNetworkView = newPlayerTransform.networkView;
theNetworkView.RPC ("setOwner", RPCMode.AllBuffered, player);
}
}
示例11: Start
// Use this for initialization
void Start () {
fighter = GetComponent<Fighter> ();
player = fighter.getPlayer ();
UIPercentage[] UIs = FindObjectsOfType<UIPercentage> ();
Debug.Log (player.ToString());
for (int i = 0; i < UIs.Length; i++) {
if (UIs [i].player == player) {
UI = UIs [i];
break;
}
}
hit = GetComponentInChildren<HitController> ();
}
示例12: CheckStatus
internal static void CheckStatus(Board board, Player player)
{
switch (TicTacRules.isGameOver(board))
{
case GameStatus.GameOver:
FireEndGame(string.Format("Jogador {0} venceu", player.ToString()), board);
break;
case GameStatus.DeuVelha:
FireEndGame("Deu Velha", board);
break;
case GameStatus.Playing:
FirePlayerChange(GetNextPlayer(player));
break;
}
}
示例13: testPayRent
public void testPayRent()
{
Utility u = new Utility();
Player p = new Player("John", 1500);
//move p so that utility rent can be calculated
p.move();
u.payRent(ref p);
//get p last move
int i = p.getLastMove();
p.ToString();
//check that p has played correct rent of 6 times last move
decimal balance = 1500 - (6 * i);
Assert.AreEqual(balance, p.getBalance());
}
示例14: Main
static void Main()
{
// Input
string[] board = new string[4];
for (int i = 0; i < 4; i++)
{
board[i] = Console.ReadLine();
}
string movement = Console.ReadLine();
// Add player and move him
var player = new Player();
var pc = new PlayerController(player, board);
pc.Move(movement);
// Display
Console.WriteLine(player.ToString());
}
示例15: ShowPlayerChange
/// <summary>
/// Shows Current Player Color
/// </summary>
/// <param name="turn"></param>
public void ShowPlayerChange(Player turn)
{
Console.WriteLine("{0}'s turn", turn.ToString());
}