Example #1
0
 public void Serialize(BinaryWriter binaryWriter)
 {
     binaryWriter.Write(Type);
     binaryWriter.Write(Index);
     binaryWriter.Write((int)State);
     binaryWriter.Write(Name);
     binaryWriter.Write(Delay);
     WalkingSprite.Serialize(binaryWriter);
     binaryWriter.Write((int)Direction);
     binaryWriter.Write(GetStep());
     binaryWriter.Write(_pauseCount);
     binaryWriter.Write(_activeCount);
     binaryWriter.Write(_walkingCount);
     binaryWriter.Write(PosInMap.X);
     binaryWriter.Write(PosInMap.Y);
 }
Example #2
0
        public void Deserialize(BinaryReader binaryReader)
        {
            Type = binaryReader.ReadInt32();

            Index = binaryReader.ReadInt32();

            State = (CharacterActionState)binaryReader.ReadInt32();
            Name  = binaryReader.ReadString();
            Delay = binaryReader.ReadInt32();

            WalkingSprite = WalkingSprite.DeserializeFromStream(Context, binaryReader);
            Direction     = (Direction)binaryReader.ReadInt32();
            SetStep(binaryReader.ReadInt32());
            _pauseCount   = binaryReader.ReadInt64();
            _activeCount  = binaryReader.ReadInt64();
            _walkingCount = binaryReader.ReadInt64();

            SetPosInMap(binaryReader.ReadInt32(), binaryReader.ReadInt32());
        }