本文整理汇总了C#中EntityCollection.addToCollection方法的典型用法代码示例。如果您正苦于以下问题:C# EntityCollection.addToCollection方法的具体用法?C# EntityCollection.addToCollection怎么用?C# EntityCollection.addToCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityCollection
的用法示例。
在下文中一共展示了EntityCollection.addToCollection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadCollection
internal EntityCollection ReadCollection(GameField field)
{
String str = sr.ReadLine();
EntityCollection collection = new EntityCollection();
while (!str.Contains("End collection"))
{
if (str.Contains("Sunk submarine"))
collection.addToCollection(ReadSunkSubmarine(field));
if (str.Contains("Marker"))
{
Marker marker = ReadMarker(field);
marker.Parent = collection;
collection.addToCollection(marker);
}
if (str.Contains("Team"))
{
Team team = readTeam(Int32.Parse(str.Split(' ').ElementAt(1)), field);
team.InitForReplay(collection);
collection.addToCollection(team);
}
str = sr.ReadLine();
}
return collection;
}
示例2: ReadInitPos
internal EntityCollection ReadInitPos(GameField field)
{
EntityCollection gameCollection = new EntityCollection();
string str = sr.ReadLine();
while (!str.Equals("End init position"))
{
if (str.Contains("Team"))
{
Team team = readTeam(Int32.Parse(str.Split(' ').ElementAt(1)), field);
team.InitForReplay(gameCollection);
gameCollection.addToCollection(team);
}
str = sr.ReadLine();
}
return gameCollection;
}
示例3: reset
public void reset()
{
GameCollection = new EntityCollection();
queue = new ActionsQueue(GameCollection, Game.GetService<GameFieldService>().GameField);
Team teamR = new Team(0, LoadAI(0), Game.GetService<GameFieldService>().GameField);
Team teamL = new Team(1, LoadAI(1), Game.GetService<GameFieldService>().GameField);
GameCollection.addToCollection(teamR);
GameCollection.addToCollection(teamL);
teamR.Initialize(GameCollection, submarineR);
teamL.Initialize(GameCollection, submarineL);
}