当前位置: 首页>>代码示例>>C#>>正文


C# World.GetCountries方法代码示例

本文整理汇总了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) });
        }
开发者ID:gitTerebi,项目名称:OpenRA,代码行数:32,代码来源:Player.cs

示例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);
            }
        }
开发者ID:jeff-1amstudios,项目名称:OpenRA,代码行数:46,代码来源:Player.cs

示例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 ) });
        }
开发者ID:subspace,项目名称:OpenRA,代码行数:22,代码来源:Player.cs

示例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) });
        }
开发者ID:FMode,项目名称:OpenRA,代码行数:18,代码来源:Player.cs

示例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);
        }
开发者ID:comradpara,项目名称:OpenRA,代码行数:27,代码来源:Player.cs


注:本文中的World.GetCountries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。