Saving/loading inherited types

Discussion and help for Easy Save 3
Post Reply
XenoBits
Posts: 3
Joined: Sun Jan 24, 2021 4:45 pm

Saving/loading inherited types

Post by XenoBits »

Hello,

first thank you for your plugin that saved me lot of time!

I have an issue that bother me on multiple part of my project and I can't seem to find a solution that satisfy me, how would you save a list of object that may contains multiple subtypes?

Let's say I have a class Zoo, that contains a List<Animals>
and this list could contains
public class Bird : Animals
or
public class Eagle : Bird

How can I be sure to save and load specific members from class that inherit from animals?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving/loading inherited types

Post by Joel »

Hi there,

I'm afraid I'm not sure I understand the question. Are you saying that a List<Animals> isn't saving correctly? You should be able to save this like any other array, and the inheritance will be persisted.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
XenoBits
Posts: 3
Joined: Sun Jan 24, 2021 4:45 pm

Re: Saving/loading inherited types

Post by XenoBits »

Thank you for your answer, it seems to work indeed sorry about this, my save management is a bit of a mess at the moment and the issues were not what I thought
Post Reply