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


C# Database.getLockeds方法代码示例

本文整理汇总了C#中db.Database.getLockeds方法的典型用法代码示例。如果您正苦于以下问题:C# Database.getLockeds方法的具体用法?C# Database.getLockeds怎么用?C# Database.getLockeds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db.Database的用法示例。


在下文中一共展示了Database.getLockeds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Player

        public Player(ClientProcessor psr)
            : base((short)psr.Character.ObjectType, psr.Random)
        {
            this.psr = psr;
            statsMgr = new StatsManager(this);
            switch(psr.Account.Rank) {
                case 0:
                    Name = psr.Account.Name; break;
                case 1:
                    Name = "[P] " + psr.Account.Name; break;
                case 2:
                    Name = "[Helper] " + psr.Account.Name; break;
                case 3:
                    Name = "[GM] " + psr.Account.Name; break;
                case 4:
                    Name = "[Dev] " + psr.Account.Name; break;
                case 5:
                    Name = "[HDev] " + psr.Account.Name; break;
                case 6:
                    Name = "[CM] " + psr.Account.Name; break;
                case 7:
                    Name = "[Founder] " + psr.Account.Name; break;
            }
            nName = psr.Account.Name;
            AccountId = psr.Account.AccountId;
            Level = psr.Character.Level;
            Experience = psr.Character.Exp;
            ExperienceGoal = GetExpGoal(psr.Character.Level);
            if (psr.Account.Rank > 2)
                Stars = 75;
            else if (psr.Account.Rank > 1)
                Stars = 60;
            else
                Stars = GetStars(); //Temporary (until pub server)
            Texture1 = psr.Character.Tex1;
            Texture2 = psr.Character.Tex2;
            Credits = psr.Account.Credits;
            NameChosen = psr.Account.NameChosen;
            CurrentFame = psr.Account.Stats.Fame;
            Fame = psr.Character.CurrentFame;
            var state = psr.Account.Stats.ClassStates.SingleOrDefault(_ => _.ObjectType == ObjectType);
            if (state != null)
                FameGoal = GetFameGoal(state.BestFame);
            else
                FameGoal = GetFameGoal(0);
            Glowing = false;
            Guild = psr.Account.Guild.Name;
            GuildRank = psr.Account.Guild.Rank;
            if (psr.Character.HitPoints <= 0)
            {
                HP = psr.Character.MaxHitPoints;
                psr.Character.HitPoints = psr.Character.MaxHitPoints;
            }
            else
                HP = psr.Character.HitPoints;
            MP = psr.Character.MagicPoints;
            ConditionEffects = 0;
            OxygenBar = 100;

            Decision = 0;
            combs = new Combinations();
            price = new Prices();

            Locked = psr.Account.Locked != null ? psr.Account.Locked : new List<int>();
            Ignored = psr.Account.Ignored != null ? psr.Account.Ignored : new List<int>();
            using (Database dbx = new Database())
            {
                Locked = dbx.getLockeds(this.AccountId);
                Ignored = dbx.getIgnoreds(this.AccountId);
            }

            Inventory = psr.Character.Equipment.Select(_ => _ == -1 ? null : (XmlDatas.ItemDescs.ContainsKey(_) ? XmlDatas.ItemDescs[_] : null)).ToArray();
            SlotTypes = Utils.FromCommaSepString32(XmlDatas.TypeToElement[ObjectType].Element("SlotTypes").Value);
            Stats = new int[]
            {
                psr.Character.MaxHitPoints,
                psr.Character.MaxMagicPoints,
                psr.Character.Attack,
                psr.Character.Defense,
                psr.Character.Speed,
                psr.Character.HpRegen,
                psr.Character.MpRegen,
                psr.Character.Dexterity,
            };

            Pet = null;
        }
开发者ID:Club559,项目名称:Mining,代码行数:87,代码来源:Player.cs

示例2: Player

        public Player(Client client)
            : base((short)client.Character.ObjectType, client.Random)
        {
            this.client = client;
            statsMgr = new StatsManager(this);
            nName = client.Account.Name;
            AccountId = client.Account.AccountId;
            Level = client.Character.Level;
            Experience = client.Character.Exp;
            ExperienceGoal = GetExpGoal(client.Character.Level);
            Stars = GetStars(); //Temporary (until pub server)
            Texture1 = client.Character.Tex1;
            Texture2 = client.Character.Tex2;
            Credits = client.Account.Credits;
            NameChosen = client.Account.NameChosen;
            CurrentFame = client.Account.Stats.Fame;
            Fame = client.Character.CurrentFame;
            var state = client.Account.Stats.ClassStates.SingleOrDefault(_ => _.ObjectType == ObjectType);
            if (state != null)
                FameGoal = GetFameGoal(state.BestFame);
            else
                FameGoal = GetFameGoal(0);
            Glowing = false;
            Guild = client.Account.Guild.Name;
            GuildRank = client.Account.Guild.Rank;
            if (client.Character.HitPoints <= 0)
            {
                HP = client.Character.MaxHitPoints;
                client.Character.HitPoints = client.Character.MaxHitPoints;
            }
            else
                HP = client.Character.HitPoints;
            MP = client.Character.MagicPoints;
            ConditionEffects = 0;
            OxygenBar = 100;

            Decision = 0;
            combs = new Combinations();
            price = new Prices();

            Locked = client.Account.Locked != null ? client.Account.Locked : new List<int>();
            Ignored = client.Account.Ignored != null ? client.Account.Ignored : new List<int>();
            using (var db = new Database())
            {
                Locked = db.getLockeds(this.AccountId);
                Ignored = db.getIgnoreds(this.AccountId);
            }

            Inventory = client.Character.Equipment.Select(_ => _ == -1 ? null : (XmlDatas.ItemDescs.ContainsKey(_) ? XmlDatas.ItemDescs[_] : null)).ToArray();
            SlotTypes = Utils.FromCommaSepString32(XmlDatas.TypeToElement[ObjectType].Element("SlotTypes").Value);
            Stats = new int[]
            {
                client.Character.MaxHitPoints,
                client.Character.MaxMagicPoints,
                client.Character.Attack,
                client.Character.Defense,
                client.Character.Speed,
                client.Character.HpRegen,
                client.Character.MpRegen,
                client.Character.Dexterity,
            };

            Pet = null;
        }
开发者ID:BlackRayquaza,项目名称:MMOE,代码行数:64,代码来源:Player.cs


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