本文整理汇总了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;
}
示例2: AcceptOrTurnInQuest
public static PacketWriter AcceptOrTurnInQuest(MapEntityIndex questProvider, QuestID questID)
{
var pw = GetWriter(ClientPacketID.AcceptOrTurnInQuest);
pw.Write(questProvider);
pw.Write(questID);
return pw;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: StartNPCChatDialog
public static PacketWriter StartNPCChatDialog(MapEntityIndex npcIndex, bool forceSkipQuestDialog)
{
var pw = GetWriter(ClientPacketID.StartNPCChatDialog);
pw.Write(npcIndex);
pw.Write(forceSkipQuestDialog);
return pw;
}
示例9: SkillStopCasting_ToMap
public static PacketWriter SkillStopCasting_ToMap(MapEntityIndex entityIndex)
{
var pw = GetWriter(ServerPacketID.SkillStopCasting_ToMap);
pw.Write(entityIndex);
return pw;
}
示例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;
}
示例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;
}
示例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;
}
示例13: Emote
public static PacketWriter Emote(MapEntityIndex mapEntityIndex, Emoticon emoticon)
{
var pw = GetWriter(ServerPacketID.Emote);
pw.Write(mapEntityIndex);
pw.WriteEnum(emoticon);
return pw;
}
示例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;
}
示例15: UseEntity
public static PacketWriter UseEntity(MapEntityIndex usedEntity, MapEntityIndex usedBy)
{
var pw = GetWriter(ServerPacketID.UseEntity);
pw.Write(usedEntity);
pw.Write(usedBy);
return pw;
}