本文整理匯總了C#中Circuit.setCurrent方法的典型用法代碼示例。如果您正苦於以下問題:C# Circuit.setCurrent方法的具體用法?C# Circuit.setCurrent怎麽用?C# Circuit.setCurrent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Circuit
的用法示例。
在下文中一共展示了Circuit.setCurrent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Load
//.........這裏部分代碼省略.........
{
baricades.Add(b);
}
}
else if (r.Name.ToLower() == "lowrowsquare")
{
LowRowSquare s = new LowRowSquare(board);
if (s.readElement(r))
{
insertInto(s.Id, s);
}
}
else if (r.Name.ToLower() == "connector")
{
Connector s = new Connector(board);
if (s.readElement(r))
{
insertInto(s.Id, s);
connectors.Add(s);
}
}
else if (r.Name.ToLower() == "player")
{
Player p = new Player(playerList);
if (p.readElement(r))
{
_numberofPlayers++;
_numberOfHumanPlayers++;
p.PlayerSquare = (PlayerSquare)linkList[find(p.PlayerSquareId)];
p.PlayerId = playerList.Count + 1;
playerList.Add(p);
}
}
else if (r.Name.ToLower() == "aiplayer")
{
AIPlayer p = new AIPlayer(playerList);
if (p.readElement(r))
{
_numberOfAIPlayers++;
_numberOfHumanPlayers++;
p.PlayerSquare = (PlayerSquare)linkList[find(p.PlayerSquareId)];
p.PlayerId = playerList.Count + 1;
playerList.Add(p);
}
}
else if (r.Name.ToLower() == "finishsquare")
{
FinishSquare s = new FinishSquare(board);
if (s.readElement(r))
{
f = s;
insertInto(s.Id, s);
previous = s;
}
}
else if (r.Name.ToLower() == "forestsquare")
{
ForestSquare s = new ForestSquare(board);
if (s.readElement(r))
{
forest = s;
insertInto(s.Id, s);
previous = s;
}
}
else if (r.Name.ToLower() == "board")
{
Board b = new Board();
if (b.readElement(r))
{
board = b;
_numberOfPawns = board.NumberOfPawns;
}
}
}
r.Close();
link();
setPiecesToSquares();
setPawnsToPlayer();
checkPlayers();
checkPieces();
playerList.setCurrent(_currentPlayer);
setPosition(f, f.X, f.Y);
conectors();
board.Squares = linkList;
board.Baricades = baricades;
if (forest != null)
{
board.ForestSquare = forest;
}
Game game = new Game(board, playerList, f);
board.Game = game;
return game;
}