本文整理汇总了C#中PlayerIndex.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerIndex.ToString方法的具体用法?C# PlayerIndex.ToString怎么用?C# PlayerIndex.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerIndex
的用法示例。
在下文中一共展示了PlayerIndex.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XInputPad
public XInputPad(PlayerIndex number)
{
padNumber = number;
if (!XPad.GetState(number).IsConnected)
{
throw new NoDeviceException("XInputパッド" + number.ToString() + "は接続されていない");
}
Config = PadConfig.GetDefault();
}
示例2: PlayerScoreDisplay
public PlayerScoreDisplay(EasyTopDownGame game, PlayerIndex playerIndex, string fontName)
: base(game, fontName)
{
Name = "Player " + playerIndex.ToString();
Score = 0;
Scale = 1.0f;
SecondsToLive = -1;
LayerDepth = LayerDepths.Front;
}
示例3: GetMap
public Buttons? GetMap(string mapName, PlayerIndex player)
{
if (string.IsNullOrEmpty(mapName))
throw new GamepadManagerException("map name is null or empty!");
GamepadMap map = _maps.FirstOrDefault(x => x.Player == player && string.Equals(x.Name, mapName));
if (map == null)
throw new GamepadManagerException(string.Format("the map \"{0}\" is not registered for player \"{1}\"!", mapName, player.ToString()));
return map.Button;
}
示例4: InitialsOf
public static string InitialsOf(PlayerIndex index)
{
#if WINDOWS
StreamReader reader = new StreamReader(OptionsMenuScreen.FolderPath + "/initials.txt");
#endif
#if XBOX
StreamReader reader = new StreamReader(StorageHelper.OpenFile("initials.txt", FileMode.Open));
#endif
string toReturn = "";
while (reader.ReadLine() != "[" + index.ToString() + "]")
{
}
toReturn = reader.ReadLine();
reader.Close();
return toReturn;
}
示例5: HandleGuide
/// <summary>
/// Begins showing the on-screen keyboard for text input via gamepad.
/// </summary>
/// <param name="pi"></param>
private void HandleGuide(PlayerIndex pi)
{
if (Manager.UseGuide && !Guide.IsVisible)
{
Guide.BeginShowKeyboardInput(pi, "Enter Text", "", Text, GetText, pi.ToString());
}
}
示例6: displayName
public String displayName(PlayerIndex player)
{
if (gamertag(player) != null)
return gamertag(player);
else return player.ToString();
}
示例7: Register
public void Register(string mapName, Buttons? button, PlayerIndex player)
{
if (string.IsNullOrEmpty(mapName))
throw new GamepadManagerException("map name is null or empty!");
if (_maps.FirstOrDefault(x => string.Equals(x.Name, mapName)) != null)
throw new GamepadManagerException(string.Format("the map \"{0}\" is already registered!", mapName));
if (_maps.FirstOrDefault(x => x.Player == player && string.Equals(x.Button, button)) != null)
throw new GamepadManagerException(string.Format("the button \"{0}\" is already registered in \"{1}\" map for player \"{2}\"!", button.ToString(), mapName, player.ToString()));
lock (_maps) { _maps.Add(new GamepadMap { Name = mapName, Button = button, Player = player }); }
}
示例8: Unregister
public void Unregister(string mapName, PlayerIndex player)
{
if (string.IsNullOrEmpty(mapName))
throw new GamepadManagerException("map name is null or empty!");
GamepadMap map = _maps.FirstOrDefault(x => x.Player == player && string.Equals(x.Name, mapName));
if (map == null)
throw new GamepadManagerException(string.Format("the map \"{0}\" is not registered for player \"{1}\"!", mapName, player.ToString()));
lock (_maps) { _maps.Remove(map); }
}
示例9: DisplayName
string DisplayName(PlayerIndex player)
{
if (GetGamerTag(player) != null)
return GetGamerTag(player);
else
return "Player " + player.ToString();
}