Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sigma 1 #230

Merged
merged 3 commits into from
Sep 21, 2017
Merged

Sigma 1 #230

merged 3 commits into from
Sep 21, 2017

Conversation

Sigma88
Copy link
Contributor

@Sigma88 Sigma88 commented Sep 21, 2017

added some stuff to enhance compatibility

@Sigma88 Sigma88 merged commit 26a6aea into master Sep 21, 2017
@Sigma88
Copy link
Contributor Author

Sigma88 commented Sep 21, 2017

these changes are simple enough that I think there shouldn't be any problems in adding them

@StollD maybe take a look to make sure I didn't do something stupid :D

@StollD
Copy link
Member

StollD commented Sep 21, 2017

I don't know if I like that currentBody stuff to be honest...

If you really want it, please add currentBody to BaseLoader, make it default to generatedBody, and change all the loaders to include a third constructor that accepts a PSystemBody. (which then sets currentBody)

@Sigma88
Copy link
Contributor Author

Sigma88 commented Sep 21, 2017

gotcha

@Sigma88
Copy link
Contributor Author

Sigma88 commented Sep 21, 2017

can I change the generatedBody to be non-static?

@Sigma88
Copy link
Contributor Author

Sigma88 commented Sep 21, 2017

I think this should do the trick

    public class BaseLoader
    {
        public PSystemBody currentBody = null;

        // Singleton of the currently edited body
        public PSystemBody generatedBody
        {
            get
            {
                if (currentBody != null)
                    return currentBody;
                else
                    return Loader.currentBody.generatedBody;
            }
        }
    }

@Sigma88
Copy link
Contributor Author

Sigma88 commented Sep 21, 2017

alternatively we could use

        public PSystemBody currentBody { internal get; set; }

instead of

        public PSystemBody currentBody = null;

@StollD
Copy link
Member

StollD commented Sep 21, 2017

I like your first suggestion, but I would suggest to make both, generatedBody and currentBody protected instead of public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants