Beispiel #1
0
        public static WeaponBase Read(this NetworkReader reader)
        {
            WeaponType weaponType = (WeaponType)reader.ReadByte();

            switch (weaponType)
            {
            case WeaponType.Default:
                return(WeaponDefault.OnDeserialize(reader));

            case WeaponType.Melee:
                return(WeaponMelee.OnDeserialize(reader));

            case WeaponType.Projectile:
                return(WeaponProjectile.OnDeserialize(reader));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }