How would I use a sound clip class, static or not?
this might be a stupid question... but it's one of those moments when I look back and go, hold on. do I want to do this?
ok so I have a soundClip class with instance variables and methods. methods like play, stop, set loopcount etc. it's basically a small class to delegate the sequencer code for sound effects.
my question is do I make this class static or not?
I didn't make it a static class but then I thought, isn't it silly to create an instance of this in each of my classes that need sound?
my sprite class is a static class with image arrays and reference numbers.
isn't sound kinda the same thing, a resource to be shared?
so basically do I turn my soundclip class into a static class with private static variables and static methods or not?
how is sound usually handled in games. what is logical?
Re: How would I use a sound clip class, static or not?
Quote:
Originally Posted by
Codeless
my question is do I make this class static or not?
Static class or utility class?
db
Re: How would I use a sound clip class, static or not?
I think you have your terminology wrong (als see Darryl's reply); only nested classes can be static; I assume you mean a class with only (public) static methods? (not unlike the System class). If there really is no need for an instance of your class it can be a possibility ...
kind regards,
Jos