Added property init function which should get everything working. Added defaults to some properties.

This commit is contained in:
Filip Maj 2016-01-10 02:44:32 -05:00
parent 9fc4101812
commit 3205bd1c83
9 changed files with 227 additions and 43 deletions

View file

@ -0,0 +1,48 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FFXIVClassic_Map_Server.packets.send.actor;
using FFXIVClassic_Map_Server.dataobjects;
namespace FFXIVClassic_Map_Server.utils
{
class ActorPropertyPacketUtil
{
Actor forActor;
uint playerActorId;
List<SubPacket> subPackets = new List<SubPacket>();
SetActorPropetyPacket currentActorPropertyPacket;
string currentTarget;
public ActorPropertyPacketUtil(string firstTarget, Actor forActor, uint playerActorId)
{
currentActorPropertyPacket = new SetActorPropetyPacket(firstTarget);
this.forActor = forActor;
this.playerActorId = playerActorId;
this.currentTarget = firstTarget;
}
public void addProperty(string property)
{
if (!currentActorPropertyPacket.addProperty(forActor, property))
{
currentActorPropertyPacket.setIsMore(true);
currentActorPropertyPacket.addTarget();
subPackets.Add(currentActorPropertyPacket.buildPacket(playerActorId, forActor.actorId));
currentActorPropertyPacket = new SetActorPropetyPacket(currentTarget);
}
}
public BasePacket done()
{
currentActorPropertyPacket.addTarget();
currentActorPropertyPacket.setIsMore(false);
subPackets.Add(currentActorPropertyPacket.buildPacket(playerActorId, forActor.actorId));
return BasePacket.createPacket(subPackets, true, false);
}
}
}