Exemple #1
0
        public void SetFullState(ByteArrayReader reader)
        {
            var isNull = reader.ReadBool();

            if (isNull)
            {
                _isNullWeapon = true;
                return;
            }
            else
            {
                _isNullWeapon = false;
            }
            TargetingType                             = (WeaponTargetingType)reader.ReadByte();
            MaxDistance                               = reader.ReadFloat();
            ProjectileType                            = ResolveTypeFromString(reader.ReadString());
            ProjectileVelocity                        = reader.ReadHalfVector();
            ProjectileOffset                          = reader.ReadHalfVector();
            ProjectileRotation                        = reader.ReadHalf();
            ProjectileRotationVelocity                = reader.ReadHalf();
            MaxActiveProjectileCount                  = reader.ReadUShort();
            FireRotationIsRelativeToTankRotation      = reader.ReadBool();
            FireRotationIsRelativeToTankLookDirection = reader.ReadBool();
            AddedRotation                             = reader.ReadHalf();
            TransformPositionAndVelocityByRotation    = reader.ReadBool();
            WeaponRechargeTime                        = reader.ReadTimeSpan();
            WeaponName    = reader.ReadString();
            TimeRecharged = reader.ReadTimeSpan();

            _projectileArray = reader.ReadBytes();
        }