本文整理汇总了C#中PlayerPosition类的典型用法代码示例。如果您正苦于以下问题:C# PlayerPosition类的具体用法?C# PlayerPosition怎么用?C# PlayerPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerPosition类属于命名空间,在下文中一共展示了PlayerPosition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LabyrinthMoveUpTest
public void LabyrinthMoveUpTest()
{
PlayerPosition startPosition = new PlayerPosition(3, 3);
string[] rawData = new string[Labyrinth.LabyrinthSize]
{
"XXXXXXX",
"X-X---X",
"X---X-X",
"X--*--X",
"X-X----",
"X-----X",
"XXXXXXX"
};
Cell[,] board = LabyrinthDataFromStringArray(rawData);
Labyrinth labyrinth = new Labyrinth(startPosition, board);
var privateObject = new PrivateObject(labyrinth);
privateObject.Invoke("ProcessMoveUp", 3, 3);
string result =
@"X X X X X X X
X - X - - - X
X - - * X - X
X - - - - - X
X - X - - - -
X - - - - - X
X X X X X X X
";
string expected = labyrinth.ToString();
Assert.AreEqual(expected, result);
}
示例2: AddMoves
/// <summary>
/// Adds all moves to Tree
/// </summary>
/// <param name="whitePos">Position of white figures on board</param>
/// <param name="moves">Pairs of moves and replies e.g. ("e2-e4", "e7-e5")</param>
public void AddMoves(PlayerPosition whitePos, params string[] moves)
{
Move temp = new Move(moves[0]);
MoveNode tempNode = new MoveNode(temp);
//iterator, that will add move to tree
MoveIterator pushingIterator = null;
MoveNode next = null;
if (!rootMoves.ContainsKey(tempNode))
{
rootMoves.Add(tempNode, tempNode);
next = rootMoves[tempNode].Add(new Move(moves[1]));
}
else
{
next = rootMoves[tempNode].Add(new Move(moves[1]));
}
pushingIterator = GetIterator(tempNode);
//next answer
pushingIterator.CurrentNode = next;
int i = 2;
while (i < moves.Length)
{
pushingIterator.CurrentNode = pushingIterator.CurrentNode.Add(moves[i], whitePos);
++i;
}
}
示例3: CheckPlayer
void CheckPlayer(PlayerPosition pla, float start, float end)
{
var p = pla.transform.position.x;
if( p >= start && p < end ) {
this.detected_players_.Add(pla);
}
}
示例4: GetNextPlayerPosition
public static PlayerPosition GetNextPlayerPosition(PlayerPosition currentSide)
{
if (currentSide.Order == 3)
return PlayerPosition.North;
return new PlayerPosition(currentSide.Order + 1);
}
示例5: PlayCard
public PlayerPosition PlayCard(Card card, PlayerPosition playerPosition)
{
_nextPlayer = BridgeHelper.GetNextPlayerPosition(playerPosition);
if (_currentTrick.Deck.Count == 0)
{
_currentTrick = new Trick();
_currentTrick.TrickDealer = playerPosition;
}
if (_currentTrick.Deck.Count <= 4)
{
card.PlayerPosition = playerPosition;
_currentTrick.Deck.Cards.Add(card);
}
if (_currentTrick.Deck.Count == 4)
{
Tricks.Add(_currentTrick);
var winner = FindWinner(_currentTrick, Contract.Trump);
_currentTrick.TrickWinner = winner;
_nextPlayer = winner;
_currentTrick = new Trick() { TrickDealer = winner };
}
GameState[playerPosition].RemoveCard(card);
return _nextPlayer;
}
示例6: PlayerInfo
public PlayerInfo this[PlayerPosition position]
{
get
{
return new PlayerInfo(this.gameManager[position]);
}
}
示例7: Init
public void Init(Action<Square> action, PlayerPosition position, Color color)
{
if (position == PlayerPosition.Up)
this.ShuffleUp(action, color);
else
this.ShuffleDown(action, color);
}
示例8: CreatePlayer
public void CreatePlayer(PlayerPosition pos)
{
GameObject obj = (GameObject) Instantiate(characterModel, new Vector3(pos.x,0,pos.y), Quaternion.identity);
Character suppo = obj.GetComponent<Character> ();
suppo.id = pos.id;
suppo.lastPosition = pos;
}
示例9: AddPosition
public void AddPosition(PlayerPosition position)
{
if (position != null && position.id != null && position.id != "")
{
positions [position.id] = position;
}
}
示例10: SetupOrientation
public void SetupOrientation(PlayerPosition pp)
{
if (pp == PlayerPosition.Up)
this.rankMask = rank8;
else
if (pp == PlayerPosition.Down)
this.rankMask = rank1;
}
示例11: PlayerBoard
public PlayerBoard(PlayerPosition playerPosition, Color playerColor, MovesArrayAllocator arrayAllocator)
{
this.position = playerPosition;
this.color = playerColor;
this.allocator = arrayAllocator;
this.ResetAll();
}
示例12: Bidding
public Bidding(GameSession gameSession, PlayerPosition startPosition)
{
_gameSession = gameSession;
Bids = new List<Bid>();
CurrentTurn = startPosition;
}
示例13: SetPosition
// --------------------------------------------------------------------------------
// AccountToPosition
// --------------------------------------------------------------------------------
// Set position
public static Coroutine SetPosition(string accountId, PlayerPosition position, GameDB.ActionOnResult<PlayerPosition> func = null)
{
return GameDB.instance.StartCoroutine(GameDB.Set<PlayerPosition>(
"AccountToPosition",
accountId,
position,
func
));
}
示例14: BridgeGame
public BridgeGame(Dictionary<PlayerPosition, Deck> state, PlayerPosition declarer)
{
GameState = state;
Tricks = new List<Trick>();
Declarer = declarer;
Dummy = BridgeHelper.GetNextPlayerPosition(BridgeHelper.GetNextPlayerPosition(declarer));
Contract = new Contract();
_currentTrick = new Trick() { TrickDealer = Declarer };
}
示例15: IsOnBoarderTest
public void IsOnBoarderTest()
{
PlayerPosition startPosition = new PlayerPosition(3, 3);
Labyrinth labyrinth = new Labyrinth(startPosition);
var privateObject = new PrivateObject(labyrinth);
var actual = privateObject.Invoke("IsOnBorder", 6, 6);
Assert.AreEqual(true, actual);
}