Can I make an object such as a “NewCharacter” global to several classes without having to pass it to each when I wish to jump from class to class?
~Fluff
Can I make an object such as a “NewCharacter” global to several classes without having to pass it to each when I wish to jump from class to class?
~Fluff
Im not really at all sure what you are asking here…
Objects are instances of classes. So a class doesnt really “hold” an object reference. About the closest thing to that I can think of are static fields which I suppose you could think of as belonging to a class…
If you want an object anyone can get out without a pre-existing reference then you put it in a sttaic field.
if only instances of class Foo can get to it then you cna put it in a private static field on foo.
If instances of many different classes shoud all be able to get to it then you make the field public and reference it as Foo.myPublicField
Alright, I’m just getting a “Stack Overflow Error” after playing the game for a bit, so I thought maybe I was creating too many New Objects. Shrugs
A stack overflow means you are winding up something recursive and never getting otu of it.
User a debugger to find your error.
Shouldn’t there be a (partial) stack trace? If so you could likely see what the problem is.