public void Depacketize(IReadablePacket packet) { var attributeCount = packet.ReadInt32(); for (var i = 0; i < attributeCount; i++) { var type = (AttributeType)packet.ReadByte(); var value = packet.ReadSingle(); Attributes.Add(type, value); } Projectiles = packet.ReadPacketizables <ProjectileFactory>(); }
public static T[] ReadPacketizablesWithTypeInfo <T>(this IReadablePacket packet) where T : class { return(packet.ReadPacketizables(Packetizable.ReadPacketizableWithTypeInfo <T>)); }
public static T[] ReadPacketizables <T>(this IReadablePacket packet) where T : class, new() { return(packet.ReadPacketizables(Packetizable.ReadPacketizable <T>)); }
public void Depacketize(IReadablePacket packet) { Effects.Clear(); Effects.AddRange(packet.ReadPacketizables <PositionedEffect>()); }
public void Depacketize(IReadablePacket packet) { Modifiers.AddRange(packet.ReadPacketizables <AttributeModifier <TAttribute> >()); }