コード例 #1
0
ファイル: Creature.cs プロジェクト: hillwah/ODK-ClientInfo
        public Creature(ref FileStream file)
        {
            //Name
            this.Name = BinarySerializer.ReadString(ref file, Encoding.ASCII);

            //SpriteTypes
            int stc = BinarySerializer.ReadInt32(ref file);
            this.SpriteTypes = new List<Int32>();
            for(int i = 0; i < stc; i++)
                this.SpriteTypes.Add(BinarySerializer.ReadInt32(ref file));

            //bMale
            this.bMale = BinarySerializer.ReadBool(ref file);

            //CreatureTribe
            this.CreatureTribe = (CREATURETRIBE)BinarySerializer.ReadByte(ref file);

            //MoveTimes
            this.MoveTimes = BinarySerializer.ReadByte(ref file);

            //MoveRatio
            this.MoveRatio = BinarySerializer.ReadByte(ref file);

            //MoveTimesMotor
            this.MoveTimesMotor = BinarySerializer.ReadByte(ref file);

            //Height, Width
            this.Height = BinarySerializer.ReadInt32(ref file);
            this.Width = BinarySerializer.ReadInt32(ref file);

            //DeadHeight
            this.DeadHeight = BinarySerializer.ReadInt32(ref file);

            //DeadActionInfo
            this.DeadActionInfo = BinarySerializer.ReadUInt16(ref file);

            //ColorSet
            this.ColorSet = BinarySerializer.ReadInt32(ref file);

            //bFlyingCreature
            this.bFlyingCreature = BinarySerializer.ReadBool(ref file);

            //FlyingHeight
            this.FlyingHeight = BinarySerializer.ReadInt32(ref file);

            //bHeadCut
            this.bHeadCut = BinarySerializer.ReadInt32(ref file);

            //HPBarWidth
            this.HPBarWidth = BinarySerializer.ReadInt32(ref file);

            //ChangeColorSet
            this.ChangeColorSet = BinarySerializer.ReadUInt16(ref file);

            //ShadowCount
            this.ShadowCount = BinarySerializer.ReadUInt16(ref file);

            //EffectStatus
            this.EffectStatus = BinarySerializer.ReadInt32(ref file);

            //Level
            this.Level = BinarySerializer.ReadInt32(ref file);

            //ActionSound
            this.ActionSound = new UInt16[this.GetActionMax()];
            for(int i = 0; i < this.ActionSound.Length; i++)
                this.ActionSound[i] = BinarySerializer.ReadUInt16(ref file);

            //ActionCount
            this.ActionCount = new Int32[this.GetActionMax()];
            for (int i = 0; i < this.ActionCount.Length; i++)
                this.ActionCount[i] = BinarySerializer.ReadInt32(ref file);

            //ItemWearInfo
            if(BinarySerializer.ReadBool(ref file)) // ItemWearInfo exists
                this.ItemWearInfo = new ItemWearInfo(ref file);

            //bFade
            this.bFade = BinarySerializer.ReadBool(ref file);

            //bFadeShadow
            this.bFadeShadow = BinarySerializer.ReadBool(ref file);

            //NewValue668
            /*this.NewValue668 = new byte[8];
            for (int i = 0; i < 8; i++)
                this.NewValue668[i] = BinarySerializer.ReadByte(ref file);*/
        }
コード例 #2
0
        public Creature(ref FileStream file)
        {
            //Name
            this.Name = BinarySerializer.ReadString(ref file, Encoding.ASCII);

            //SpriteTypes
            int stc = BinarySerializer.ReadInt32(ref file);

            this.SpriteTypes = new List <Int32>();
            for (int i = 0; i < stc; i++)
            {
                this.SpriteTypes.Add(BinarySerializer.ReadInt32(ref file));
            }

            //bMale
            this.bMale = BinarySerializer.ReadBool(ref file);

            //CreatureTribe
            this.CreatureTribe = (CREATURETRIBE)BinarySerializer.ReadByte(ref file);

            //MoveTimes
            this.MoveTimes = BinarySerializer.ReadByte(ref file);

            //MoveRatio
            this.MoveRatio = BinarySerializer.ReadByte(ref file);

            //MoveTimesMotor
            this.MoveTimesMotor = BinarySerializer.ReadByte(ref file);

            //Height, Width
            this.Height = BinarySerializer.ReadInt32(ref file);
            this.Width  = BinarySerializer.ReadInt32(ref file);

            //DeadHeight
            this.DeadHeight = BinarySerializer.ReadInt32(ref file);

            //DeadActionInfo
            this.DeadActionInfo = BinarySerializer.ReadUInt16(ref file);

            //ColorSet
            this.ColorSet = BinarySerializer.ReadInt32(ref file);

            //bFlyingCreature
            this.bFlyingCreature = BinarySerializer.ReadBool(ref file);

            //FlyingHeight
            this.FlyingHeight = BinarySerializer.ReadInt32(ref file);

            //bHeadCut
            this.bHeadCut = BinarySerializer.ReadInt32(ref file);

            //HPBarWidth
            this.HPBarWidth = BinarySerializer.ReadInt32(ref file);

            //ChangeColorSet
            this.ChangeColorSet = BinarySerializer.ReadUInt16(ref file);

            //ShadowCount
            this.ShadowCount = BinarySerializer.ReadUInt16(ref file);

            //EffectStatus
            this.EffectStatus = BinarySerializer.ReadInt32(ref file);

            //Level
            this.Level = BinarySerializer.ReadInt32(ref file);

            //ActionSound
            this.ActionSound = new UInt16[this.GetActionMax()];
            for (int i = 0; i < this.ActionSound.Length; i++)
            {
                this.ActionSound[i] = BinarySerializer.ReadUInt16(ref file);
            }

            //ActionCount
            this.ActionCount = new Int32[this.GetActionMax()];
            for (int i = 0; i < this.ActionCount.Length; i++)
            {
                this.ActionCount[i] = BinarySerializer.ReadInt32(ref file);
            }

            //ItemWearInfo
            if (BinarySerializer.ReadBool(ref file)) // ItemWearInfo exists
            {
                this.ItemWearInfo = new ItemWearInfo(ref file);
            }

            //bFade
            this.bFade = BinarySerializer.ReadBool(ref file);

            //bFadeShadow
            this.bFadeShadow = BinarySerializer.ReadBool(ref file);

            //NewValue668

            /*this.NewValue668 = new byte[8];
             * for (int i = 0; i < 8; i++)
             *  this.NewValue668[i] = BinarySerializer.ReadByte(ref file);*/
        }