本文整理汇总了C#中Square.readElement方法的典型用法代码示例。如果您正苦于以下问题:C# Square.readElement方法的具体用法?C# Square.readElement怎么用?C# Square.readElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Square
的用法示例。
在下文中一共展示了Square.readElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public Game Load(String uri)
{
XmlReader r = XmlReader.Create(uri);
board = null;
FinishSquare f = null;
ForestSquare forest = null;
Square previous = null;
playerSquares = new List<PlayerSquare>();
linkList = new List<Square>();
playerList = new Circuit<Player>();
baricades = new List<BaricadePiece>();
pawns = new List<Pawn>();
baricadeSquares = new List<Square>();
connectors = new List<Connector>();
while (r.Read())
{
if (r.Name.ToLower() == "square")
{
Square s = new Square(board);
if (s.readElement(r))
{
s.View = new VSquare(s);
insertInto(s.Id, s);
previous = s;
}
}
else if (r.Name.ToLower() == "villagesquare")
{
VillageSquare s = new VillageSquare(board);
if (s.readElement(r))
{
insertInto(s.Id, s);
previous = s;
}
}
else if (r.Name.ToLower() == "baricadesquare")
{
BaricadeSquare s = new BaricadeSquare(board);
if (s.readElement(r))
{
insertInto(s.Id, s);
baricadeSquares.Add(s);
previous = s;
}
}
else if (r.Name.ToLower() == "baricadevillagesquare")
{
BaricadeVillageSquare s = new BaricadeVillageSquare(board);
if(s.readElement(r))
{
insertInto(s.Id, s);
baricadeSquares.Add(s);
previous = s;
}
}
else if (r.Name.ToLower() == "restsquare")
{
RestSquare s = new RestSquare(board);
if(s.readElement(r))
{
insertInto(s.Id,s);
}
}
else if (r.Name.ToLower() == "playersquare")
{
PlayerSquare s = new PlayerSquare(board);
if (s.readElement(r))
{
playerSquares.Add(s);
insertInto(s.Id, s);
previous = s;
}
}
else if (r.Name.ToLower() == "pawn")
{
Pawn p = new Pawn();
if (p.readElement(r))
{
pawns.Add(p);
}
}
else if (r.Name.ToLower() == "baricadepiece")
{
BaricadePiece b = new BaricadePiece();
if (b.readElement(r))
{
baricades.Add(b);
}
}
//.........这里部分代码省略.........