本文整理汇总了C#中PlayerPosition类的典型用法代码示例。如果您正苦于以下问题:C# PlayerPosition类的具体用法?C# PlayerPosition怎么用?C# PlayerPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerPosition类属于命名空间,在下文中一共展示了PlayerPosition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:30,代码来源:Labyrinth.Tests.cs
示例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;
}
}
开发者ID:Ribtoks,项目名称:Queem,代码行数:36,代码来源:DebutGraph.cs
示例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);
}
}
开发者ID:madeso,项目名称:nomoresweden2015,代码行数:7,代码来源:Eyes.cs
示例4: GetNextPlayerPosition
public static PlayerPosition GetNextPlayerPosition(PlayerPosition currentSide)
{
if (currentSide.Order == 3)
return PlayerPosition.North;
return new PlayerPosition(currentSide.Order + 1);
}
开发者ID:pdm55,项目名称:dds.net,代码行数:7,代码来源:BridgeHelper.cs
示例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;
}
开发者ID:pdm55,项目名称:dds.net,代码行数:30,代码来源:BridgeGame.cs
示例6: PlayerInfo
public PlayerInfo this[PlayerPosition position]
{
get
{
return new PlayerInfo(this.gameManager[position]);
}
}
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:7,代码来源:GameInfo.cs
示例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);
}
开发者ID:Ribtoks,项目名称:Queem,代码行数:7,代码来源:InitialFigureShuffler.cs
示例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;
}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:8,代码来源:WorldManager.cs
示例9: AddPosition
public void AddPosition(PlayerPosition position)
{
if (position != null && position.id != null && position.id != "")
{
positions [position.id] = position;
}
}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:8,代码来源:PositionQueue.cs
示例10: SetupOrientation
public void SetupOrientation(PlayerPosition pp)
{
if (pp == PlayerPosition.Up)
this.rankMask = rank8;
else
if (pp == PlayerPosition.Down)
this.rankMask = rank1;
}
开发者ID:Ribtoks,项目名称:Queem,代码行数:8,代码来源:RookBitBoard.cs
示例11: PlayerBoard
public PlayerBoard(PlayerPosition playerPosition, Color playerColor, MovesArrayAllocator arrayAllocator)
{
this.position = playerPosition;
this.color = playerColor;
this.allocator = arrayAllocator;
this.ResetAll();
}
开发者ID:Ribtoks,项目名称:Queem,代码行数:8,代码来源:PlayerBoard.cs
示例12: Bidding
public Bidding(GameSession gameSession, PlayerPosition startPosition)
{
_gameSession = gameSession;
Bids = new List<Bid>();
CurrentTurn = startPosition;
}
开发者ID:shahboura,项目名称:Tarneeb,代码行数:8,代码来源:Bidding.cs
示例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
));
}
开发者ID:judah4,项目名称:battle-of-mages,代码行数:13,代码来源:PositionsDB.cs
示例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 };
}
开发者ID:pdm55,项目名称:dds.net,代码行数:9,代码来源:BridgeGame.cs
示例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);
}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:9,代码来源:Labyrinth.Tests.cs
示例16: IsGameWonTestFalse
public void IsGameWonTestFalse()
{
PlayerPosition startPosition = new PlayerPosition(3, 3);
Labyrinth labyrinth = new Labyrinth(startPosition);
var privateObject = new PrivateObject(labyrinth);
var actual = privateObject.Invoke("IsGameWon", 3, 3);
Assert.AreEqual(false, actual);
}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:9,代码来源:Labyrinth.Tests.cs
示例17: SantaseGame
public SantaseGame(IPlayer firstPlayer, IPlayer secondPlayer, PlayerPosition firstToPlay)
{
this.firstPlayerTotalPoints = 0;
this.secondPlayerTotalPoints = 0;
this.roundsCount = 0;
this.firstPlayer = firstPlayer;
this.secondPlayer = secondPlayer;
this.firstToPlay = firstToPlay;
}
开发者ID:darkyto,项目名称:HQC-Course,代码行数:9,代码来源:SantaseGame.cs
示例18: SendPosition
public void SendPosition(PlayerPosition position)
{
channel.BasicPublish(
exchange: POSITION_EXCHANGE_NAME,
routingKey: POSITION_TAG_NAME,
basicProperties: null,
body: position.ToMessageData()
);
}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:9,代码来源:MessageHandler.cs
示例19: Start
IEnumerator Start()
{
Application.runInBackground = true;
id = System.Guid.NewGuid().ToString();
lastPos = new PlayerPosition (id, 0, 0, 0);
posQ.AddPosition (new PlayerPosition (id, 0, 0, 0));
mh = new MessageHandler ();
yield return StartCoroutine(mh.startListening ());
}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:9,代码来源:MovementController.cs
示例20: Contract
public Contract(PlayerPosition playerPosition, ContractType type, bool isDoubled = false, bool isReDoubled = false)
: this()
{
this.IsAvailable = true;
this.Type = type;
this.PlayerPosition = playerPosition;
this.OriginalBidder = playerPosition;
this.IsDoubled = isDoubled;
this.IsReDoubled = isReDoubled;
}
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:10,代码来源:Contract.cs
注:本文中的PlayerPosition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论