2016-06-08 22:29:04 +01:00
|
|
|
|
using FFXIVClassic_Map_Server.packets;
|
2016-01-10 02:44:32 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
2016-01-20 23:18:10 -05:00
|
|
|
|
using FFXIVClassic_Map_Server.Actors;
|
2016-01-10 02:44:32 -05:00
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.utils
|
|
|
|
|
{
|
|
|
|
|
class ActorPropertyPacketUtil
|
|
|
|
|
{
|
2016-03-19 18:43:02 -04:00
|
|
|
|
private Actor forActor;
|
|
|
|
|
private uint playerActorId;
|
|
|
|
|
private List<SubPacket> subPackets = new List<SubPacket>();
|
|
|
|
|
private SetActorPropetyPacket currentActorPropertyPacket;
|
|
|
|
|
private string currentTarget;
|
2016-01-10 02:44:32 -05:00
|
|
|
|
|
|
|
|
|
public ActorPropertyPacketUtil(string firstTarget, Actor forActor, uint playerActorId)
|
|
|
|
|
{
|
|
|
|
|
currentActorPropertyPacket = new SetActorPropetyPacket(firstTarget);
|
|
|
|
|
this.forActor = forActor;
|
|
|
|
|
this.playerActorId = playerActorId;
|
|
|
|
|
this.currentTarget = firstTarget;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public void AddProperty(string property)
|
2016-01-10 02:44:32 -05:00
|
|
|
|
{
|
2016-06-14 21:29:10 +01:00
|
|
|
|
if (!currentActorPropertyPacket.AddProperty(forActor, property))
|
2016-01-10 02:44:32 -05:00
|
|
|
|
{
|
2016-06-14 21:29:10 +01:00
|
|
|
|
currentActorPropertyPacket.SetIsMore(true);
|
|
|
|
|
currentActorPropertyPacket.AddTarget();
|
|
|
|
|
subPackets.Add(currentActorPropertyPacket.BuildPacket(playerActorId, forActor.actorId));
|
2016-01-10 02:44:32 -05:00
|
|
|
|
currentActorPropertyPacket = new SetActorPropetyPacket(currentTarget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 00:08:05 +01:00
|
|
|
|
public void NewTarget(string target)
|
2016-03-12 10:01:41 -05:00
|
|
|
|
{
|
2016-06-14 21:29:10 +01:00
|
|
|
|
currentActorPropertyPacket.AddTarget();
|
2016-06-15 00:08:05 +01:00
|
|
|
|
currentTarget = target;
|
|
|
|
|
currentActorPropertyPacket.SetTarget(target);
|
2016-03-12 10:01:41 -05:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public List<SubPacket> Done()
|
2016-01-10 02:44:32 -05:00
|
|
|
|
{
|
2016-06-14 21:29:10 +01:00
|
|
|
|
currentActorPropertyPacket.AddTarget();
|
|
|
|
|
currentActorPropertyPacket.SetIsMore(false);
|
|
|
|
|
subPackets.Add(currentActorPropertyPacket.BuildPacket(playerActorId, forActor.actorId));
|
2016-03-12 02:52:34 -05:00
|
|
|
|
return subPackets;
|
2016-01-10 02:44:32 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|