本文整理汇总了C#中Players类的典型用法代码示例。如果您正苦于以下问题:C# Players类的具体用法?C# Players怎么用?C# Players使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Players类属于命名空间,在下文中一共展示了Players类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisualPlayer
public VisualPlayer(Players.Player player)
{
if (player == null)
return;
lock (player)
{
this.Name = player.Name;
this.PlayerUniqueId = player.UniqueId;
this.Phase = player.Phase;
this.PlayerMode = player.PlayerMode;
// This sometimes has an Enumeration exception -- can't figure out how to Lock it properly
try { this.VictoryPoints = player.VictoryPoints; }
catch { this.VictoryPoints = 0; }
this.Revealed = player.Revealed;
Cards.CardCollection discardCards = new Cards.CardCollection();
for (int i = 0; i < player.DiscardPile.Count - 1; i++)
discardCards.Add(new Cards.Universal.Dummy());
if (player.DiscardPile.Count - 1 > 0)
discardCards.Add(player.DiscardPile.First());
this.DiscardPile.AddRange(player, discardCards);
Cards.CardCollection privateCards = new Cards.CardCollection();
for (int i = 0; i < player.DiscardPile.Count; i++)
privateCards.Add(new Cards.Universal.Dummy());
this.DiscardPile.AddRange(player, privateCards);
}
}
示例2: StartNew
public void StartNew()
{
board.CreateBoard();
currentPlayer = Players.PlayerOne;
OnBoardChanged();
}
示例3: AcceptMove
public void AcceptMove(Players player, int column)
{
if (!IsMoveValid(column))
{
switch (player)
{
case Players.Black:
throw new InvalidMoveException(GameResult.InvalidMoveBlack);
case Players.Red:
throw new InvalidMoveException(GameResult.InvalidMoveRed);
default:
throw new Exception("Unexpected player value");
}
}
for (int i = Rows - 1; i >= 0; i--)
{
if (_board[i, column] == Players.None)
{
_board[i, column] = player;
return;
}
}
throw new Exception("Unable to process player move.");
}
示例4: Reveal
/// <summary>
/// Reveal Override. For Spawner Gizmos there is no reveal necessary.
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Reveal(Players.Player player)
{
if (player.RevealedObjects.ContainsKey(this.DynamicID)) return false; // already revealed
player.RevealedObjects.Add(this.DynamicID, this);
//Start triggered conversation
if (this.TriggeredConversation != null)
{
StartConversation(this.World, this.TriggeredConversation.Id);
Logger.Debug("triggered conversation: {0}", this.TriggeredConversation.Id);
}
if (this.TriggeredConversation1 != null)
{
StartConversation(this.World, this.TriggeredConversation1.Id);
Logger.Debug("triggered conversation: {0}", this.TriggeredConversation1.Id);
}
if (this.TriggeredActor != null)
{
//TODO: Verify spawn position?
}
if (this.OnActorSpawnedScript != null)
{
this.World.Game.Scripts[OnActorSpawnedScript.Id].Execute();
}
return true;
}
示例5: OnAddSocket
public void OnAddSocket(Players.Player player, Item item)
{
// TODO: Animate Jeweler? Who knows. /fasbat
item.Attributes[GameAttribute.Sockets] += 1;
// Why this not work? :/
item.Attributes.SendChangedMessage(player.InGameClient, item.DynamicID);
}
示例6: OnTargeted
public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message)
{
World.BroadcastIfRevealed(new PlayAnimationMessage
{
ActorID = this.DynamicID,
Field1 = 5,
Field2 = 0,
tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[]
{
new Net.GS.Message.Fields.PlayAnimationMessageSpec()
{
Duration = 50,
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening],
PermutationIndex = 0,
Speed = 1
}
}
}, this);
World.BroadcastIfRevealed(new SetIdleAnimationMessage
{
ActorID = this.DynamicID,
AnimationSNO = AnimationSetKeys.Open.ID
}, this);
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
this.Attributes[GameAttribute.Gizmo_State] = 1;
Attributes.BroadcastChangedIfRevealed();
base.OnTargeted(player, message);
}
示例7: CreatePositionData
public CreatePositionData(List<PiecePosition> pieces,
Players player_to_move,
Castle white_castling_options,
Castle black_castling_options,
int? capture_en_passant_column,
ushort fullmove_number,
ushort halfmove_clock)
{
if (pieces == null)
{
throw new ArgumentNullException();
}
if (capture_en_passant_column.HasValue
&& (capture_en_passant_column < Chessboard.COLUMN_MIN
|| capture_en_passant_column > Chessboard.COLUMN_MAX))
{
throw new ArgumentOutOfRangeException();
}
m_pieces = pieces;
m_player_to_move = player_to_move;
m_white_castling_options = white_castling_options;
m_black_castling_options = black_castling_options;
m_capture_en_passant_column = capture_en_passant_column;
m_fullmove_number = fullmove_number;
m_halfmove_clock = halfmove_clock;
}
示例8: ChangeTurn
private Players ChangeTurn(Players item)
{
if (opponent == Opponents.Player)
{
foreach (var card in firstPlayerGameCards)
card.SetVisible(false);
foreach (var card in secondPlayerGameCards)
card.SetVisible(false);
skip1.Visible = false;
skip2.Visible = false;
if (item == Players.First)
{
MessageBox.Show("Player 2 turn", "Football");
foreach (var card in secondPlayerGameCards)
card.SetVisible(true);
skip2.Visible = true;
item = Players.Second;
}
else
{
MessageBox.Show("Player 1 turn", "Football");
foreach (var card in firstPlayerGameCards)
card.SetVisible(true);
skip1.Visible = true;
item = Players.First;
}
}
else
{
item = item == Players.First ? Players.Second : Players.First;
}
return item;
}
示例9: Player
public Player(Texture2D texture, Players playerIndex)
: base(texture, new WeaponSet(new Laser(GameBase.Textures["Laser"])))
{
Position = new Vector2(GameBase.DisplaySetting.Width * 0.5f - (Width * 0.5f), GameBase.DisplaySetting.Height - Height);
Vector = Vector2.Zero;
PlayerIndex = playerIndex;
}
示例10: GameController
/// <summary>
/// Initializes a new instance of the <see cref="GameController"/> class.
/// </summary>
/// <param name="isOnline">if set to <c>true</c> [the game is online].</param>
/// <param name="names">The names of the players.</param>
/// <param name="sizeOfBoard">The size of board.</param>
public GameController(bool isOnline, List<string> names, uint sizeOfBoard)
{
IsOnline = isOnline;
Players = new Players(names, Globals.NumberOfLetters);
Board = new Board(0, sizeOfBoard);
Changes = new CircularList<Change>();
IsFirstTime = true;
}
示例11: GetProperties
public async static Task<JObject> GetProperties(Players player, JArray properties)
{
JObject parameters = new JObject(
new JProperty("playerid", getIdFromPlayers(player)),
new JProperty("properties", properties));
JObject responseObject = await ConnectionManager.ExecuteRPCRequest("Player.GetProperties", parameters);
return (JObject)responseObject["result"];
}
示例12: IsPieceAt
public bool IsPieceAt(ChessboardCell cell, out Players player,
out Exports.Pieces piece)
{
int data = m_cells[cell.Value];
player = (Players)DecodePlayer(data);
piece = (Exports.Pieces)DecodePiece(data);
return piece != Exports.Pieces.NoPiece;
}
示例13: Parse
public static Players Parse(SpeedrunComClient client, dynamic playersElement)
{
var players = new Players();
players.Value = (int)playersElement.value;
players.Type = playersElement.type == "exactly" ? PlayersType.Exactly : PlayersType.UpTo;
return players;
}
示例14: GetAssignedInput
public PlayerInput GetAssignedInput(Players player)
{
PlayerInput playerInput;
if (!assignedInputs.TryGetValue(player, out playerInput))
Debug.LogError(string.Format("No PlayerInput has been assigned to {0}.", player));
return playerInput;
}
示例15: OnTargeted
public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message)
{
Logger.Warn("Healthwell has no function, Powers not implemented");
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
this.Attributes[GameAttribute.Gizmo_State] = 1;
Attributes.BroadcastChangedIfRevealed();
}