Esempio n. 1
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationHelper.Variables v = context.GetVars();
            info.AddValue("type", type);
            info.AddValue("passable", passable);

            if (v.FullySerializeEverything || v.FullySerialized.Contains(onTile.GUID))
            {
                info.AddValue("onTile", onTile);
            }
            else
            {
                info.AddValue("onTileGUID", OnTile.GUID.ToString());
            }

            //Serialization of seenBy is split up so only Living objects that need to be fully serialized are.
            Dictionary <string, float> guidBasedSeenBy = new Dictionary <string, float>();
            Dictionary <Living, float> fullSeenBy      = new Dictionary <Living, float>();

            foreach (KeyValuePair <Living, float> kvp in seenBy)
            {
                if (v.FullySerializeEverything || v.FullySerialized.Contains(kvp.Key.GUID))
                {
                    fullSeenBy.Add(kvp.Key, kvp.Value);
                }
                else
                {
                    guidBasedSeenBy.Add(kvp.Key.GUID.ToString(), kvp.Value);
                }
            }
            info.AddValue("seenBy", fullSeenBy);
            info.AddValue("seenByGUIDs", guidBasedSeenBy);
            base.GetObjectData(info, context);
        }
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationHelper.Variables v = context.GetVars();
            if (item == null || v.FullySerializeEverything || v.FullySerialized.Contains(item.GUID))
            {
                info.AddValue("item", item);
            }
            else
            {
                info.AddValue("itemGUID", item.GUID.ToString());
            }

            base.GetObjectData(info, context);
        }
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     SerializationHelper.Variables v = context.GetVars();
     if (v.FullySerializeEverything || v.FullySerialized.Contains(parentTile.GUID))
     {
         info.AddValue("parentTile", parentTile);
     }
     else
     {
         info.AddValue("parentTileGUID", parentTile.GUID.ToString());
     }
     info.AddValue("open", open);
     base.GetObjectData(info, context);
 }
Esempio n. 4
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationHelper.Variables v = context.GetVars();
            if (v.FullySerializeEverything || v.FullySerialized.Contains(mouseSlot.GUID))
            {
                info.AddValue("mouseSlot", mouseSlot);
            }
            else
            {
                info.AddValue("mouseSlotGUID", mouseSlot.GUID.ToString());
            }

            info.AddValue("playerType", playerType);
            info.AddValue("playerNameTitle", playerNameTitle);
            info.AddValue("exp", exp);
            info.AddValue("freeStatPoints", freeStatPoints);
            base.GetObjectData(info, context);
        }
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationHelper.Variables v = context.GetVars();
            if (v.FullySerializeEverything || v.FullySerialized.Contains(iBox.GUID))
            {
                info.AddValue("iBox", iBox);
            }
            else
            {
                info.AddValue("iBoxGUID", iBox.GUID.ToString());
            }

            info.AddValue("Closed", Closed);
            info.AddValue("floorNumber", floorNumber);
            info.AddValue("openContainerSprite", openContainerSprite);
            info.AddValue("openSound", openSound);

            base.GetObjectData(info, context);
        }
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);

            //animations
            info.AddValue("idleAnimation", idleAnimation);
            info.AddValue("moveAnimation", moveAnimation);
            info.AddValue("dieAnimation", dieAnimation);
            info.AddValue("dieSound", dieSound);

            SerializationHelper.Variables v = context.GetVars();
            if (v.FullySerializeEverything || v.FullySerialized.Contains(inventory.GUID))
            {
                info.AddValue("inventory", inventory);
            }
            else
            {
                info.AddValue("inventoryGUID", inventory.GUID.ToString());
            }

            if (v.FullySerializeEverything || v.FullySerialized.Contains(equipmentSlots.GUID))
            {
                info.AddValue("equipmentSlots", equipmentSlots);
            }
            else
            {
                info.AddValue("equipmentSlotsGUID", equipmentSlots.GUID.ToString());
            }

            if (v.FullySerializeEverything || v.FullySerialized.Contains(skillList.GUID))
            {
                info.AddValue("skillList", skillList);
            }
            else
            {
                info.AddValue("skillListGUID", skillList.GUID.ToString());
            }

            if (currentSkill == null || v.FullySerializeEverything || v.FullySerialized.Contains(currentSkill.GUID))
            {
                info.AddValue("currentSkill", currentSkill);
            }
            else
            {
                info.AddValue("currentSkillGUID", currentSkill.GUID.ToString());
            }

            //stats
            info.AddValue("manaPoints", manaPoints);
            info.AddValue("healthPoints", healthPoints);
            info.AddValue("actionPoints", actionPoints);
            info.AddValue("baseAttack", baseAttack);
            info.AddValue("strength", strength);
            info.AddValue("dexterity", dexterity);
            info.AddValue("intelligence", intelligence);
            info.AddValue("creatureLevel", creatureLevel);
            info.AddValue("vitality", vitality);
            info.AddValue("wisdom", wisdom);
            info.AddValue("luck", luck);
            info.AddValue("baseReach", baseReach);
            info.AddValue("specialReach", specialReach);
            info.AddValue("viewDistance", viewDistance);
        }