本文整理汇总了C#中World.GetCountries方法的典型用法代码示例。如果您正苦于以下问题:C# World.GetCountries方法的具体用法?C# World.GetCountries怎么用?C# World.GetCountries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.GetCountries方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Player
public Player(World world, Session.Client client, PlayerReference pr, int index)
{
World = world;
Index = index;
Palette = "player" + index;
InternalName = pr.Name;
PlayerRef = pr;
if (client != null)
{
ClientIndex = client.Index;
ColorRamp = client.ColorRamp;
PlayerName = client.Name;
Country = world.GetCountries()
.FirstOrDefault(c => client.Country == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
}
else
{
ClientIndex = 0; /* it's a map player, "owned" by host */
ColorRamp = pr.ColorRamp;
PlayerName = pr.Name;
NonCombatant = pr.NonCombatant;
Country = world.GetCountries()
.FirstOrDefault(c => pr.Race == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
}
PlayerActor = world.CreateActor("Player", new TypeDictionary { new OwnerInit(this) });
}
示例2: Player
public Player(World world, Session.Client client, Session.Slot slot, PlayerReference pr)
{
World = world;
InternalName = pr.Name;
PlayerReference = pr;
string botType = null;
// Real player or host-created bot
if (client != null)
{
ClientIndex = client.Index;
ColorRamp = client.ColorRamp;
PlayerName = client.Name;
botType = client.Bot;
Country = world.GetCountries()
.FirstOrDefault(c => client.Country == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
}
else
{
// Map player
ClientIndex = 0; // Owned by the host (todo: fix this)
ColorRamp = pr.ColorRamp;
PlayerName = pr.Name;
NonCombatant = pr.NonCombatant;
botType = pr.Bot;
Country = world.GetCountries()
.FirstOrDefault(c => pr.Race == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
}
PlayerActor = world.CreateActor("Player", new TypeDictionary { new OwnerInit(this) });
// Enable the bot logic on the host
IsBot = botType != null;
if (IsBot && Game.IsHost)
{
var logic = PlayerActor.TraitsImplementing<IBot>()
.FirstOrDefault(b => b.Info.Name == botType);
if (logic == null)
Log.Write("debug", "Invalid bot type: {0}", botType);
else
logic.Activate(this);
}
}
示例3: Player
public Player( World world, PlayerReference pr, int index )
{
World = world;
Shroud = new ShroudRenderer(this, world.Map);
Index = index;
Palette = "player"+index;
Color = pr.Color;
Color2 = pr.Color2;
ClientIndex = 0; /* it's a map player, "owned" by host */
PlayerName = InternalName = pr.Name;
NonCombatant = pr.NonCombatant;
Country = world.GetCountries()
.FirstOrDefault(c => pr.Race == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
PlayerRef = pr;
RegisterPlayerColor(world, Palette);
PlayerActor = world.CreateActor("Player", new TypeDictionary{ new OwnerInit( this ) });
}
示例4: Player
public Player(World world, Session.Client client, PlayerReference pr, int index)
{
World = world;
Index = index;
Palette = "player" + index;
ColorRamp = client.ColorRamp;
PlayerName = client.Name;
InternalName = pr.Name;
Country = world.GetCountries()
.FirstOrDefault(c => client != null && client.Country == c.Race)
?? world.GetCountries().Random(world.SharedRandom);
ClientIndex = client.Index;
PlayerRef = pr;
PlayerActor = world.CreateActor("Player", new TypeDictionary { new OwnerInit(this) });
}
示例5: Player
public Player( World world, Session.Client client )
{
World = world;
Shroud = new ShroudRenderer(this, world.Map);
PlayerActor = world.CreateActor("Player", new int2(int.MaxValue, int.MaxValue), this);
if (client != null)
{
Index = client.Index;
Palette = PlayerColors[client.PaletteIndex % PlayerColors.Count()].a;
Color = PlayerColors[client.PaletteIndex % PlayerColors.Count()].c;
PlayerName = client.Name;
InternalName = "Multi{0}".F(client.Index);
}
else
{
Index = -1;
PlayerName = InternalName = "Neutral";
Palette = "neutral";
Color = Color.Gray; // HACK HACK
}
Country = world.GetCountries()
.FirstOrDefault(c => client != null && client.Country == c.Name)
?? world.GetCountries().Random(world.SharedRandom);
}