• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Race类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Race的典型用法代码示例。如果您正苦于以下问题:C# Race类的具体用法?C# Race怎么用?C# Race使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Race类属于命名空间,在下文中一共展示了Race类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LateUpdate

    void LateUpdate()
    {
        if (enabled && Network.isServer)
        {
            var lSceneManager = GameSceneManager.Singleton;

            if (race == Race.eNone && owner)
                race = PlayerInfo.getRace(owner.layer);

            //有race,则只优化敌队的传输
            if (race == Race.ePismire)
                addTo(lSceneManager.getManager(Race.eBee,
                    GameSceneManager.UnitManagerType.heroSpawn).managerRoot);
            else if (race == Race.eBee)
                addTo(lSceneManager.getManager(Race.ePismire,
                    GameSceneManager.UnitManagerType.heroSpawn).managerRoot);
            else
            {
            //将自己增加到英雄的BoundNetworkScope中
                addTo(lSceneManager.getManager(Race.ePismire,
                    GameSceneManager.UnitManagerType.heroSpawn).managerRoot);
                addTo(lSceneManager.getManager(Race.eBee,
                    GameSceneManager.UnitManagerType.heroSpawn).managerRoot);
            }

        }
        enabled = false;
    }
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:28,代码来源:NetworkScopeObject.cs


示例2: buildRace

    public void buildRace(Race pRace)
    {
        if (Network.isServer)
        {
            var lViewID = Network.AllocateViewID();
            var lIntRace = (int)pRace;
            StrongholdSetBuilding(lViewID, lIntRace);
            networkView.RPC("StrongholdSetBuilding", RPCMode.Others, lViewID, lIntRace);
            networkView.enabled = false;
            //if (occupied)
            //{
            //    Debug.LogError("buildRace occupied");
            //    return;
            //}
            //strongholdBuilding = zzCreatorUtility
            //    .Instantiate(getBuilding(pRace), transform.position, transform.rotation, 0);
            //sendMessageWhenDie lSendMessageWhenDie
            //    = strongholdBuilding.GetComponent<sendMessageWhenDie>();
            //lSendMessageWhenDie.messageReceiver = gameObject;
            //owner = pRace;

            //if (Network.peerType != NetworkPeerType.Disconnected)
            //    networkView.RPC("RPCBuildRace", RPCMode.Others,
            //        strongholdBuilding.networkView.viewID, (int)owner);
            //networkView.enabled = false;
            //occupiedEvent();
            //raceChangedEvent(pRace);
        }
        else if (Network.peerType== NetworkPeerType.Disconnected)
        {
            setBuilding((GameObject)Instantiate(getBuilding(pRace)), pRace);
        }
    }
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:33,代码来源:Stronghold.cs


示例3: EnsureLoaded

        private void EnsureLoaded()
        {
            using (new ReaderLock(_lock))
            {
                if (_loaded) return;

                using (new WriterLock(_lock))
                {
                    if (_loaded) return;

                    if (null == _cache)
                        _cache = new List<Race>();

                    Connection.ExecuteSql(new Query(RACE_SELECT), delegate(SqlDataReader reader)
                    {
                        while (reader.Read())
                        {
                            if (null != _cache.Find(c => reader[0].ToString() == c.Name))
                                return;

                            var newRace = new Race()
                            {
                                Name = reader[0].ToString()
                            };

                            _cache.Add(newRace);
                        }
                    });

                    _loaded = true;
                }
            }
        }
开发者ID:anxkha,项目名称:DRM,代码行数:33,代码来源:RaceStore.cs


示例4: GetNextFiishPosition_PlayersExist_ReturnsExpectedFinishPosition

        public void GetNextFiishPosition_PlayersExist_ReturnsExpectedFinishPosition()
        {
            var race = new Race();
            race.CreatePlayers(new Character[3] { Character.Mario, Character.Luigi, Character.Peach });

            race.GetNextFinishPosition().Should().Be(1);
        }
开发者ID:shealey,项目名称:CodeKatas,代码行数:7,代码来源:RaceTests.cs


示例5: GetNextFinishPosition_PlayersIsNull_ThrowsArgumentNullException

        public void GetNextFinishPosition_PlayersIsNull_ThrowsArgumentNullException()
        {
            var race = new Race();

            Action action = () => race.GetNextFinishPosition();
            action.ShouldThrow<ArgumentException>().And.Message.Contains("No Players created");
        }
开发者ID:shealey,项目名称:CodeKatas,代码行数:7,代码来源:RaceTests.cs


示例6: _testSimple

        private IEnumerable<RaceControl<string>> _testSimple(Race<string> race)
        {
            Console.WriteLine("operation called on thread {0}, name '{1}'", Thread.CurrentThread.ManagedThreadId,
                              Thread.CurrentThread.Name);
            int nId = Thread.CurrentThread.ManagedThreadId;

            yield return race.RunAs("x");
            Console.WriteLine("Should be in x");
            Console.WriteLine("operation called on thread {0}, name '{1}'", Thread.CurrentThread.ManagedThreadId,
                              Thread.CurrentThread.Name);

            int xId = Thread.CurrentThread.ManagedThreadId;
            Assert.AreNotEqual(nId, xId);

            yield return race.RunAs("y");
            Console.WriteLine("Should be in y");
            Console.WriteLine("operation called on thread {0}, name '{1}'", Thread.CurrentThread.ManagedThreadId,
                              Thread.CurrentThread.Name);

            int yId = Thread.CurrentThread.ManagedThreadId;
            Assert.AreNotEqual(nId, yId);
            Assert.AreNotEqual(xId, nId);

            yield return race.RunAs("x");
            Console.WriteLine("Should be in x again");
            Console.WriteLine("operation called on thread {0}, name '{1}'", Thread.CurrentThread.ManagedThreadId,
                              Thread.CurrentThread.Name);
            Assert.AreEqual(Thread.CurrentThread.ManagedThreadId, xId);
        }
开发者ID:lcorneliussen,项目名称:Braindrops,代码行数:29,代码来源:RaceTest.cs


示例7: Create_World_And_Hexes

        public void Create_World_And_Hexes()
        {
            var race = new Race { Name = "Default Race" };
            var nation = new Nation { Name = "Default Nation", Race = race };
            var user = new User { Email = "[email protected]", FirstName = "Jamie", LastName = "Fraser", OpenId = "http://jamief00.myopenid.com/" };
            var world = new World { Height = 100, Width = 100, Name = "Default World" };
            var game = new Game { Name = "Default Game", Started = DateTime.Now, GameWorld = world};
            var gameSession = new GameSession { EnteredGame = DateTime.Now, Nation = nation, Game = game, User = user };

            using (var tran = _dataContext.WorldRepository.Session.BeginTransaction())
            {
                _dataContext.RaceRepository.Save(race);
                _dataContext.NationRepository.Save(nation);
                _dataContext.UserRepository.Save(user);
                _dataContext.GameRepository.Save(game);
                _dataContext.WorldRepository.Save(world);
                _dataContext.GameSessionRepository.Save(gameSession);

                for (var y = 1; y <= world.Width; y++)
                {
                    for (var x = 1; x <= world.Height; x++)
                    {
                        var hex = new Hex { World = world, HexType = HexType.Grass, X = x, Y = y };

                        _dataContext.HexRepository.Save(hex);
                    }
                }

                tran.Commit();
            }
        }
开发者ID:Think-Jumper,项目名称:everland,代码行数:31,代码来源:WorldTests.cs


示例8: StartNewCampaign

      private void StartNewCampaign(Race setRace)
      {
         Campaign campaign = new Campaign(setRace);
         campaign.StartNew();

         MainGame.WinWarGame.SetNextGameScreen(new LevelGameScreen(campaign));
      }
开发者ID:CAMongrel,项目名称:WinWar,代码行数:7,代码来源:ChooseCampaignWindow.cs


示例9: Character

    public Character(Class cClass, Race cRace)
    {
        GameState.Instance.Character = this;
        //Assign character race + class
        charClass = cClass;
        charRace = cRace;

        //Create the player object
        this.Player = (GameObject)GameObject.Instantiate(Resources.Load("Player"));
        //Create the camera object
        this.camera = (GameObject)GameObject.Instantiate(Resources.Load("Camera"));
        //Create minimap camera object
        this.miniMap = (GameObject)GameObject.Instantiate(Resources.Load("MiniMapCam"));

        Cam cam = this.camera.AddComponent<Cam>();
        cam.target = this.Player;

        Cam camMini = this.miniMap.AddComponent<Cam>();
        camMini.target = this.Player;

        Health = MaxHealth;

        UIMain.SetCharLevel();
        UIMain.SetExp();
        UIMain.SetHealth();
        UIMain.SetLevel();
        UIMain.SetCharLevel();

        this.CharClass.Init();
    }
开发者ID:stijnhero,项目名称:Game,代码行数:30,代码来源:Character.cs


示例10: RaceAnalyzer

 private RaceAnalyzer(Race race)
 {
     _race = race;
     _analyzers.Add(new HeaderAnalyst() {Race = race});
     _analyzers.Add(new FirstTimesAnalyst() { Race = race });
     _analyzers.Add(new LayoffAnalyst() { Race = race });
 }
开发者ID:jpazarzis,项目名称:hogar,代码行数:7,代码来源:RaceAnalyzer.cs


示例11: CharacterCreateMenu

        public CharacterCreateMenu(WSOGame theGame, Client theClient)
        {
            myGame = theGame;
            netClient = theClient;

            characterRace = Race.Human;
            hairStyleID = 0;
            hairColorID = 0;
            faceStyleID = 0;
            shirtStyleID = 0;
            shirtColorID = 0;
            legsStyleID = 0;
            legsColorID = 0;
            skinColorID = 0;

            spr_HeadSprite = myGame.graphicsManager.Heads[(byte)characterRace][hairStyleID];
            spr_TorsoSprite = myGame.graphicsManager.Torsos[(byte)characterRace][shirtStyleID];
            spr_LegsSprite = myGame.graphicsManager.Legs[(byte)characterRace][legsStyleID];
            spr_FootSprite = myGame.graphicsManager.Feet[(byte)characterRace][legsStyleID];
            spr_ArmsSprite = myGame.graphicsManager.Arms[(byte)characterRace][shirtStyleID];

            spr_Shadow = myGame.graphicsManager.Shadow;

            characterPosition = new Vector2(520, 431);

            characterSlot = 0;
        }
开发者ID:rillyboss,项目名称:Whispered-Scrolls-Online-Client,代码行数:27,代码来源:CharacterCreateMenu.cs


示例12: Item

        /// <summary>
        /// Base deserialization constructor.
        /// </summary>
        /// <param name="src"></param>
        internal Item(MarketGroup group, SerializableItem src)
            : this(src.ID, src.Name)
        {
            m_marketGroup = group;

            m_icon = src.Icon;
            m_race = src.Race;
            m_slot = src.Slot;
            m_family = src.Family;
            m_description = src.Description;

            m_metaLevel = src.MetaLevel;
            m_metaGroup = src.MetaGroup;

            m_reprocessing = new FastList<Material>(0);
            m_properties = new PropertiesCollection(src.Properties);

            // Skills prerequisites
            m_prerequisites = new FastList<StaticSkillLevel>((src.Prereqs != null ? src.Prereqs.Length : 0));
            if (src.Prereqs == null)
                return;

            foreach (var prereq in src.Prereqs)
            {
                m_prerequisites.Add(new StaticSkillLevel(prereq.ID, prereq.Level));
            }
        }
开发者ID:wow4all,项目名称:evemu_server,代码行数:31,代码来源:Item.cs


示例13: IngameMenuWindow

        internal IngameMenuWindow(Race setRace)
        {
            curRace = setRace;
             LevelGameScreen.Game.GamePaused = true;

             BackgroundColor = new Microsoft.Xna.Framework.Color (0.3f, 0.0f, 0.0f, 0.5f);

             //Width = background.Width;
             //Height = background.Height;

             UIResource res = WarFile.GetUIResource(setRace == Race.Humans ? 368 : 369);

             background = new UIImage(WWTexture.FromImageResource(WarFile.GetImageResource(res.BackgroundImageResourceIndex)));
             background.InitWithUIResource (res);
             AddComponent (background);

             background.X = 120;
             background.Y = 20;

             continueButton = (UIButton)background.Components [6];
             continueButton.OnMouseUpInside += closeButton_OnMouseUpInside;

             quitButton = (UIButton)background.Components [5];
             quitButton.OnMouseUpInside += quitButton_OnMouseUpInside;

             MouseCursor.State = MouseCursorState.Pointer;
        }
开发者ID:CAMongrel,项目名称:WinWar,代码行数:27,代码来源:IngameMenuWindow.cs


示例14: Apply

        public void Apply(Race race)
        {
            race.Horses.ForEach(horse => horse.NeuralNetworkOpinion = NeuralNetworkOpinion.NoOpinion);

            var map = new Dictionary<Horse, StarterInfo>();
            List<StarterInfo> starterInfoCollection = race.Horses.Select(horse => CreateStarterInfo(horse, map)).Where(si => null != si).ToList();

            int numberOfHorses = race.Horses.Count(h => h.Scratched == false);

            if (starterInfoCollection.Count <= (numberOfHorses * 0.7))
                return;

            var selections = GetSelections(starterInfoCollection);

            foreach (var horse in map.Keys)
            {
                horse.Votes = map[horse].Votes;
                if (null != selections.Find(si=>si==map[horse]))
                {
                    horse.NeuralNetworkOpinion = NeuralNetworkOpinion.IsABet;
                }
                else
                {
                    horse.NeuralNetworkOpinion = NeuralNetworkOpinion.NotABet;
                }
            }
        }
开发者ID:jpazarzis,项目名称:hogar,代码行数:27,代码来源:DetectWinnerNeuronNetwork.SelectionEngine.cs


示例15: TestFoo

 public void TestFoo()
 {
     using (var multi = new Race<string>())
     {
         multi.Execute(_testSimple);
     }
 }
开发者ID:lcorneliussen,项目名称:Braindrops,代码行数:7,代码来源:RaceTest.cs


示例16: AddNewCharacter

        /// <summary>
        /// add a new character to this account, if the newly created character abides to some rules
        /// </summary>
        /// <param name="name">name of the character</param>
        /// <param name="level">level of the character</param>
        /// <param name="race">race of the character</param>
        /// <param name="faction">faction of the character</param>
        /// <param name="class">class of the character</param>
        /// <returns>return true if the creation wnet smoothly</returns>
        public bool AddNewCharacter(Guid id, string name, int level, Race race, Faction faction, Class @class)
        {
            var newCharacter = new Character()
            {
                Id = id,
                Name = name,
                Level = level,
                Race = race,
                Faction = faction,
                Class = @class
            };

            if ( CharacterSpecifications.Factions
                            .And(CharacterSpecifications.DruidSpecifications)
                            .And(CharacterSpecifications.BloodElfSpecifications)
                            .IsSatisfiedBy(newCharacter)
                            && AccountSpecifications.DeathKnightSpecifications(newCharacter)
                            .IsSatisfiedBy(this))
            {
                Characters.Add(newCharacter);
                return true;
            }
            else
                return false;
        }
开发者ID:arthis,项目名称:furry-journey,代码行数:34,代码来源:Account.cs


示例17: TestThreadStatic

 public void TestThreadStatic()
 {
     using (var race = new Race<Formula1Teams>())
     {
         race.Execute(_testThreadStatic);
     }
 }
开发者ID:lcorneliussen,项目名称:Braindrops,代码行数:7,代码来源:RaceTest.cs


示例18: TestAsync

 public void TestAsync()
 {
     using (var multi = new Race<string>())
     {
         multi.Execute(_testAsync);
     }
 }
开发者ID:lcorneliussen,项目名称:Braindrops,代码行数:7,代码来源:RaceTest.cs


示例19: Player

        public Player(string name, int level, int exp, int ac, int life, int maxLife, 
            int str, int dex, int con, int intel, 
            int wis, int cha, Race characterRace, Class characterClass, int gold, 
            Weapon equippedWeapon, Spells equippedSpell, Item slot1, Item slot2)
        {
            Random rand = new Random();

            Name = name;
            Level = level;
            Exp = exp;
            AC = ac;
            MaxLife = maxLife;
            Life = life;
            Str = str;
            Dex = dex;
            Con = con;
            Intel = intel;
            Wis = wis;
            Cha = cha;
            Gold = gold;
            CharacterClass = characterClass;
            CharacterRace = characterRace;
            EquippedWeapon = equippedWeapon;
            EquippedSpell = equippedSpell;
            Slot1 = slot1;
            Slot2 = slot2;
        }
开发者ID:TheLentzCode,项目名称:Dungeon-Game,代码行数:27,代码来源:Player.cs


示例20: Variable

 public Variable(string name, 
             string fullName, 
             int length,
             int height,
             int gapTop,
             int gapRight,
             int gapBottom,
             int gapLeft,
             Race race,
             int treedepth,
             int value = -1)
     : this(name,
       fullName,
       new ghost.Domain( -1 ),
       length,
       height,
       gapTop,
       gapRight,
       gapBottom,
       gapLeft,
       race,
       treedepth,
       value)
 {
 }
开发者ID:richoux,项目名称:GHOST_C_sharp,代码行数:25,代码来源:Variable.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RadComboBox类代码示例发布时间:2022-05-24
下一篇:
C# RabbitMQ类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap