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


C# MapEntityIndex类代码示例

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


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

示例1: CharDamage

 public static PacketWriter CharDamage(MapEntityIndex mapEntityIndex, int damage)
 {
     var pw = GetWriter(ServerPacketID.CharDamage);
     pw.Write(mapEntityIndex);
     pw.Write(damage);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ServerPacket.cs

示例2: AcceptOrTurnInQuest

 public static PacketWriter AcceptOrTurnInQuest(MapEntityIndex questProvider, QuestID questID)
 {
     var pw = GetWriter(ClientPacketID.AcceptOrTurnInQuest);
     pw.Write(questProvider);
     pw.Write(questID);
     return pw;
 }
开发者ID:Furt,项目名称:netgore,代码行数:7,代码来源:ClientPacket.cs

示例3: ItemEntity

        public ItemEntity(MapEntityIndex mapEntityIndex, Vector2 pos, Vector2 size, GrhIndex graphicIndex, TickCount currentTime)
            : base(pos, size)
        {
            Amount = 0;

            ((IDynamicEntitySetMapEntityIndex)this).SetMapEntityIndex(mapEntityIndex);
            _grh = new Grh(GrhInfo.GetData(graphicIndex), AnimType.Loop, currentTime);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:8,代码来源:ItemEntity.cs

示例4: Attack

 public static PacketWriter Attack(MapEntityIndex? target)
 {
     var pw = GetWriter(ClientPacketID.Attack);
     pw.Write(target.HasValue);
     if (target.HasValue)
         pw.Write(target.Value);
     return pw;
 }
开发者ID:Furt,项目名称:netgore,代码行数:8,代码来源:ClientPacket.cs

示例5: ChatSay

 public static PacketWriter ChatSay(string name, MapEntityIndex mapEntityIndex, string text)
 {
     var pw = GetWriter(ServerPacketID.ChatSay);
     pw.Write(name, GameData.MaxServerSayNameLength);
     pw.Write(mapEntityIndex);
     pw.Write(text, GameData.MaxServerSayLength);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:8,代码来源:ServerPacket.cs

示例6: CharAttack

        public static PacketWriter CharAttack(MapEntityIndex attacker, MapEntityIndex? attacked = null, ActionDisplayID? actionDisplay = null)
        {
            var pw = GetWriter(ServerPacketID.CharAttack);
            pw.Write(attacker);

            pw.Write(attacked.HasValue);
            if (attacked.HasValue)
                pw.Write(attacked.Value);

            pw.Write(actionDisplay.HasValue);
            if (actionDisplay.HasValue)
                pw.Write(actionDisplay.Value);

            return pw;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:15,代码来源:ServerPacket.cs

示例7: GetTargetCharacter

        static Character GetTargetCharacter(Character user, MapEntityIndex? index)
        {
            if (!index.HasValue)
                return null;

            // Check for a valid user
            if (user == null || user.Map == null)
                return null;

            // Check for a valid target index
            var target = user.Map.GetDynamicEntity<Character>(index.Value);
            if (target == null || target.Map != user.Map)
                return null;

            // Check for a valid distance
            if (user.GetDistance(target) > GameData.MaxTargetDistance)
                return null;

            return target;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:20,代码来源:ServerPacketHandler.cs

示例8: StartNPCChatDialog

 public static PacketWriter StartNPCChatDialog(MapEntityIndex npcIndex, bool forceSkipQuestDialog)
 {
     var pw = GetWriter(ClientPacketID.StartNPCChatDialog);
     pw.Write(npcIndex);
     pw.Write(forceSkipQuestDialog);
     return pw;
 }
开发者ID:Furt,项目名称:netgore,代码行数:7,代码来源:ClientPacket.cs

示例9: SkillStopCasting_ToMap

 public static PacketWriter SkillStopCasting_ToMap(MapEntityIndex entityIndex)
 {
     var pw = GetWriter(ServerPacketID.SkillStopCasting_ToMap);
     pw.Write(entityIndex);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:6,代码来源:ServerPacket.cs

示例10: CreateActionDisplayAtEntity

        public static PacketWriter CreateActionDisplayAtEntity(ActionDisplayID actionDisplayId, MapEntityIndex sourceEntityIndex, MapEntityIndex? targetEntityIndex = null)
        {
            var pw = GetWriter(ServerPacketID.CreateActionDisplayAtEntity);
            pw.Write(actionDisplayId);
            pw.Write(sourceEntityIndex);

            pw.Write(targetEntityIndex.HasValue);
            if (targetEntityIndex.HasValue)
                pw.Write(targetEntityIndex.Value);

            return pw;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:ServerPacket.cs

示例11: SkillStartCasting_ToMap

 public static PacketWriter SkillStartCasting_ToMap(MapEntityIndex entityIndex, SkillType skillType)
 {
     var pw = GetWriter(ServerPacketID.SkillStartCasting_ToMap);
     pw.Write(entityIndex);
     pw.WriteEnum(skillType);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ServerPacket.cs

示例12: SetUserChar

 /// <summary>
 /// Sets which map character is the one controlled by the user
 /// </summary>
 /// <param name="mapEntityIndex">Map character index controlled by the user</param>
 public static PacketWriter SetUserChar(MapEntityIndex mapEntityIndex)
 {
     var pw = GetWriter();
     SetUserChar(pw, mapEntityIndex);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:ServerPacket.cs

示例13: Emote

 public static PacketWriter Emote(MapEntityIndex mapEntityIndex, Emoticon emoticon)
 {
     var pw = GetWriter(ServerPacketID.Emote);
     pw.Write(mapEntityIndex);
     pw.WriteEnum(emoticon);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ServerPacket.cs

示例14: StartQuestChatDialog

        public static PacketWriter StartQuestChatDialog(MapEntityIndex npcIndex, IEnumerable<QuestID> availableQuests,
                                                        IEnumerable<QuestID> turnInQuests)
        {
            var pw = GetWriter(ServerPacketID.StartQuestChatDialog);

            pw.Write(npcIndex);

            // Write the list of available quests
            if (availableQuests != null)
            {
                var values = availableQuests.ToImmutable();
                Debug.Assert(values.Count() <= byte.MaxValue);
                pw.Write((byte)values.Count());
                foreach (var q in values)
                {
                    pw.Write(q);
                }
            }
            else
                pw.Write((byte)0);

            // Write the list of quests that can be turned in
            if (turnInQuests != null)
            {
                var values = turnInQuests.ToImmutable();
                Debug.Assert(values.Count() <= byte.MaxValue);
                pw.Write((byte)values.Count());
                foreach (var q in values)
                {
                    pw.Write(q);
                }
            }
            else
                pw.Write((byte)0);

            return pw;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:37,代码来源:ServerPacket.cs

示例15: UseEntity

 public static PacketWriter UseEntity(MapEntityIndex usedEntity, MapEntityIndex usedBy)
 {
     var pw = GetWriter(ServerPacketID.UseEntity);
     pw.Write(usedEntity);
     pw.Write(usedBy);
     return pw;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ServerPacket.cs


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