示例#1
0
文件: Weapon.cs 项目: matrix4x4/Space
        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>();
        }
示例#2
0
 public static T[] ReadPacketizablesWithTypeInfo <T>(this IReadablePacket packet)
     where T : class
 {
     return(packet.ReadPacketizables(Packetizable.ReadPacketizableWithTypeInfo <T>));
 }
示例#3
0
 public static T[] ReadPacketizables <T>(this IReadablePacket packet)
     where T : class, new()
 {
     return(packet.ReadPacketizables(Packetizable.ReadPacketizable <T>));
 }
示例#4
0
 public void Depacketize(IReadablePacket packet)
 {
     Effects.Clear();
     Effects.AddRange(packet.ReadPacketizables <PositionedEffect>());
 }
示例#5
0
 public void Depacketize(IReadablePacket packet)
 {
     Modifiers.AddRange(packet.ReadPacketizables <AttributeModifier <TAttribute> >());
 }