- Home /
Queue methods.
I am at the moment working on a system to queue action in my game. I tried to store it as delegates in a Queue but run into problem with that the methods has different parameters.
I figured out one way to bypass my problem by creating a Queue for every type of action and then on Queue with a enum value that shows what Queue I should use. But it gets quite unendurable then you starts to get a lot of different actions.
What other ways is it to do a queue system in C#?
Don't think this is a Unity question, but: make something with the bare $$anonymous$$imum with what you need to Queue -- action speed, or time(?) the icon, and a single link to the action.
$$anonymous$$aybe every Action inherits from that. Or maybe it's just the index of the player or monster, and they know what they are planning on doing (so you call player.ActNow() or something.)
If this is a scripting question, and what you're asking is "how can I create a queue that can hold multiple types of classes?", the answer is to either derive all classes (actions) from a single root type, or do a Queue
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Learning Unity Methods 1 Answer
Accessing a Nonstatic method from another script 2 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer