Exemple #1
0
        public override void Decode()
        {
            bool[][] mAllBitBunch = FreedomAIEncoderAndDecoder.BreakBitBunch(mbitbunch, mBreakPoint);

            mColor  = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[0], 0.0f, 1.0f);
            mHeight = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[1], 1.0f, 2.5f);
            mAllhp  = FreedomAIEncoderAndDecoder.BitBunch2int(mAllBitBunch[2], 2000, 4000);
            float tx = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[3], 0.0f, 1.0f); tx = (mpos_rightup.x - mpos_leftdown.x) * tx + mpos_leftdown.x;
            float tz = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch [4], 0.0f, 1.0f); tz = (mpos_rightup.z - mpos_leftdown.z) * tz + mpos_leftdown.z;

            mPosition = new Vector3(tx, mpos_rightup.y, tz);
            mHp       = mAllhp;
        }
Exemple #2
0
        public override void Decode()
        {
            bool[][] mAllBitBunch = FreedomAIEncoderAndDecoder.BreakBitBunch(mbitbunch, mBreakPoint);
            string   s            = "";

            mStrongRate = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[0], 0.0f, 1.0f);
            mVelocity   = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[1], 6.0f, 9.0f);
            mLife       = FreedomAIEncoderAndDecoder.BitBunch2int(mAllBitBunch[2], 1000, 2000); mTempLife = mLife;
            float tx = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[3], 0.0f, 1.0f); tx = (mpos_rightup.x - mpos_leftdown.x) * tx + mpos_leftdown.x;
            float tz = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch [4], 0.0f, 1.0f); tz = (mpos_rightup.z - mpos_leftdown.z) * tz + mpos_leftdown.z;

            Type      = FreedomAIEncoderAndDecoder.BitBunch2bool(mAllBitBunch[5]);
            mPosition = new Vector3(tx, mpos_rightup.y, tz);
        }
Exemple #3
0
        public override void Decode()
        {
            base.Decode();
            bool[][] mAllBitBunch = FreedomAIEncoderAndDecoder.BreakBitBunch(mbitbunch, mBreakPoint);
            float    posx         = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[0], mpos_leftdown.x, mpos_rightup.x);
            float    posz         = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[1], mpos_leftdown.z, mpos_rightup.z);
            int      life         = FreedomAIEncoderAndDecoder.BitBunch2int(mAllBitBunch[2], 1000, 2000);
            float    strong       = FreedomAIEncoderAndDecoder.BitBunch2float(mAllBitBunch[3], 0.0f, 1.0f);

            mPosition.x = posx;
            mPosition.y = mpos_leftdown.y;
            mPosition.z = posz;
            mLife       = life; mTempLife = mLife;
            mStrongRate = strong;
        }