So I’m trying to build a turn based battle system in which a player can take a specific number of actions per turn. Additionally a player can manipulate the times when these actions will be taken and at the end the actions will play out at the player-determined times.
I’m kind of at loss at how to approach this and would appreciate a hint at how to accomplish this. Right now I’ve tried queueing my actions / functions by storing them in a list, I’ve tried using delegates and queues but a problem I encounter is the use of different parameters for my functions, i.e. a Move function for a unit will take a Vector3 targetPosition but a SwapWeapon function for a unit will take a Int index parameter. Additionally right now I’m implementing my action functions by using Coroutines, so I can call them at various times and overlap each other but since these aren’t working the way I want yet this is up for change as well.
I imagine I could implement the timer by letting the player choose the starting times of his actions, then when it’s time to execute just starting a timer and calling the function in my queue at the respective time but I haven’t tried implementing this bit yet.
Thanks for any answer I might get.