예제 #1
0
        public override void Stream(SaveStream stream)
        {
            base.Stream(stream);

            mNPCIdentity.Stream(stream);
            stream.Stream(ref mStartingPosition);
            stream.Stream(ref mRelaxedPosition);
        }
예제 #2
0
        public void Stream(SaveStream stream)
        {
            if (stream.IsWriting())
            {
                Debug.Assert(InitialRooms.IsValidInitialRoomIndex(mInitialRoomIndex));
                stream.Stream(ref mInitialRoomIndex);
            }
            else
            {
                InitialRooms.ID roomIndex = InitialRooms.ID.Unknown;
                stream.Stream(ref roomIndex);
                SetInitialRoomIndex(roomIndex);
                LoadStaticGridFromInitialRoom();
            }

            int dynamicObjectCount = mDynamicObjects.Count;

            stream.Stream(ref dynamicObjectCount, SaveUtils.GetNumBitsToStoreValue(maxNumDynamicObjects));

            if (stream.IsWriting())
            {
                foreach (DynamicObject dynamicObject in mDynamicObjects)
                {
                    dynamicObject.Stream(stream);
                }
            }
            else
            {
                mDynamicObjects.Clear();

                for (int dynamicObjectIndex = 0; dynamicObjectIndex < dynamicObjectCount; dynamicObjectIndex++)
                {
                    DynamicObject dynamicObject = (DynamicObject)Emoji.CreateObject(stream as ReadStream);

                    dynamicObject.Stream(stream);
                    mDynamicObjects.Add(dynamicObject);
                }
            }
        }
예제 #3
0
        public void Stream(SaveStream stream)
        {
            int numEntries = mEntries.Count;

            stream.Stream(ref numEntries, SaveUtils.GetNumBitsToStoreValue(maxInventorySize));

            if (stream.IsWriting())
            {
                foreach (InventoryEntry entry in mEntries)
                {
                    entry.Stream(stream);
                }
            }
            else
            {
                for (int entryIndex = 0; entryIndex < numEntries; entryIndex++)
                {
                    InventoryEntry entry = new InventoryEntry();
                    entry.Stream(stream);
                    mEntries.Add(entry);
                }
            }
        }
예제 #4
0
        private void Stream(SaveStream stream)
        {
            if (!stream.IsWriting())
            {
                NPCIdentifier.currentMaxID = 0;
            }

            mInventory.Stream(stream);
            mRoom.Stream(stream);
            mGameTime.Stream(stream);

            int numNPCData = mNPCIdentities.Count;

            stream.Stream(ref numNPCData, SaveUtils.GetNumBitsToStoreValue(NPCIdentifier.maxNumNPCs));

            if (stream.IsWriting())
            {
                foreach (KeyValuePair <int, NPCIdentityData> pair in mNPCIdentities)
                {
                    int id = pair.Key;
                    stream.Stream(ref id, SaveUtils.GetNumBitsToStoreValue(NPCIdentifier.maxNumNPCs - 1));
                    pair.Value.Stream(stream);
                }
            }
            else
            {
                mNPCIdentities.Clear();
                for (int npcIdentityIndex = 0; npcIdentityIndex < numNPCData; npcIdentityIndex++)
                {
                    int             id   = 0;
                    NPCIdentityData data = new NPCIdentityData();
                    stream.Stream(ref id, SaveUtils.GetNumBitsToStoreValue(NPCIdentifier.maxNumNPCs - 1));
                    data.Stream(stream);
                    mNPCIdentities[id] = data;
                }
            }
        }
예제 #5
0
 public override void Stream(SaveStream stream)
 {
     stream.Stream(ref mType);
     stream.Stream(ref mPosition);
 }
예제 #6
0
 public void Stream(SaveStream stream)
 {
     stream.Stream(ref mId, SaveUtils.GetNumBitsToStoreValue(maxNumNPCs));
 }
예제 #7
0
 public void Stream(SaveStream stream)
 {
     stream.Stream(ref mSkinToneIndex, SaveUtils.GetNumBitsToStoreValue(StringUtils.GetNumSkinToneVariations() - 1));
     stream.Stream(ref mGenderIndex, SaveUtils.GetNumBitsToStoreValue(StringUtils.GetNumGenderVariations() - 1));
 }
예제 #8
0
        public override void Stream(SaveStream stream)
        {
            base.Stream(stream);

            stream.Stream(ref mIsMovingTowardsFlower);
        }
예제 #9
0
        public override void Stream(SaveStream stream)
        {
            base.Stream(stream);

            mIdentifier.Stream(stream);
        }
예제 #10
0
 public override void Stream(SaveStream stream)
 {
     stream.Stream(ref mTimeLeft, 2);
 }
예제 #11
0
 public void Stream(SaveStream stream)
 {
     stream.Stream(ref mType);
 }
예제 #12
0
 public void Stream(SaveStream stream)
 {
     stream.Stream(ref mTimeInHoursAfterMidnight, SaveUtils.GetNumBitsToStoreValue(23));
 }
예제 #13
0
        public override void Stream(SaveStream stream)
        {
            base.Stream(stream);

            stream.Stream(ref mIsWalkingRight);
        }