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


C# Identity.Equals方法代码示例

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


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

示例1: Add

        public bool Add(Identity from, IItem item)
        {
            if (from.Equals(this.Shopper))
            {
                this.vendorsBag.Add(this.vendorsBag.FindFreeSlot(), item);
                LogUtil.Debug(DebugInfoDetail.Shopping, "Added Item from character " + from.ToString(true));
            }
            else
            {
                this.charactersBag.Add(from.Instance);
                LogUtil.Debug(DebugInfoDetail.Shopping, "Added Item from shop on position " + from.ToString(true));
            }

            // For now no invalid trades
            return true;
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:16,代码来源:TemporaryBag.cs

示例2: ExecuteCommand

        /// <summary>
        /// </summary>
        /// <param name="character">
        /// </param>
        /// <param name="target">
        /// </param>
        /// <param name="args">
        /// </param>
        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            List<MessageBody> replies = new List<MessageBody>();
            string reply = "Looking up for statel in playfield " + character.Playfield.Identity.Instance;
            replies.Add(ChatTextMessageHandler.Default.Create(character, reply));
            StatelData o = null;
            StaticDynel o2 = null;
            Vendor o3 = null;
            Coordinate tempCoordinate = character.Coordinates();
            if (!PlayfieldLoader.PFData.ContainsKey(character.Playfield.Identity.Instance))
            {
                reply = "Could not find data for playfield " + character.Playfield.Identity.Instance;
                replies.Add(ChatTextMessageHandler.Default.Create(character, reply));
            }
            else
            {
                if (target.Equals(Identity.None))
                {
                    PlayfieldData pfData = PlayfieldLoader.PFData[character.Playfield.Identity.Instance];
                    foreach (StatelData s in pfData.Statels)
                    {
                        if (o == null)
                        {
                            o = s;
                        }
                        else
                        {
                            if (Coordinate.Distance2D(tempCoordinate, s.Coord())
                                < Coordinate.Distance2D(tempCoordinate, o.Coord()))
                            {
                                o = s;
                            }
                        }
                    }

                    foreach (StaticDynel sd in Pool.Instance.GetAll<StaticDynel>(character.Playfield.Identity))
                    {
                        if (o2 == null)
                        {
                            o2 = sd;
                        }
                        else
                        {
                            if (Coordinate.Distance2D(tempCoordinate, sd.Coordinate)
                                < Coordinate.Distance2D(tempCoordinate, o2.Coordinate))
                            {
                                o2 = sd;
                            }
                        }

                    }

                }
                else
                {
                    o =
                        PlayfieldLoader.PFData[character.Playfield.Identity.Instance].Statels.FirstOrDefault(
                            x => x.Identity == target);
                    o2 =
                        Pool.Instance.GetAll<StaticDynel>(character.Playfield.Identity)
                            .FirstOrDefault(x => x.Identity == target);
                    o3 =
                        Pool.Instance.GetAll<Vendor>(character.Playfield.Identity)
                            .FirstOrDefault(x => x.Identity == target);
                }

                if ((o == null) && (o2 == null) && (o3 == null))
                {
                    replies.Add(
                        ChatTextMessageHandler.Default.Create(
                            character,
                            "No statel/static dynel on this playfield... Very odd, where exactly are you???"));
                }
                else
                {
                    if (o3 != null)
                    {
                        replies.Add(
                                                    ChatTextMessageHandler.Default.Create(
                                                        character,
                                                        o3.Identity.Type.ToString() + " " + ((int)o3.Identity.Type).ToString("X8") + ":"
                                                        + o3.Identity.Instance.ToString("X8")));
                        replies.Add(
                            ChatTextMessageHandler.Default.Create(character, "Item Template Id: " + o3.Template.ID));
                        foreach (Event se in o3.Events)
                        {
                            replies.Add(ChatTextMessageHandler.Default.Create(character, se.ToString()));
                        }
                    }
                    else if (((o != null) && (o2 == null))
                        || ((o != null) && (Coordinate.Distance2D(tempCoordinate, o.Coord())
                            < Coordinate.Distance2D(tempCoordinate, o2.Coordinate))))
//.........这里部分代码省略.........
开发者ID:CellAO,项目名称:CellAO-NightPredator,代码行数:101,代码来源:ShowStatel.cs

示例3: Remove

 public IItem Remove(Identity from, int slot)
 {
     if (from.Equals(this.Shopper))
     {
         LogUtil.Debug(DebugInfoDetail.Shopping, "Removed Item from character in shopbag from slot " + slot);
         return this.vendorsBag.Remove(slot);
     }
     this.charactersBag.Remove(slot);
     return null;
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:10,代码来源:TemporaryBag.cs


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