Topic List | Page List: 1 |
---|---|
Topic | ProgrammingGeneral++ |
1337toothbrush 12/29/21 11:01:48 PM #21: | s0nicfan posted... FYI if you're going to keep the characters in an array you might as well use a priority queue that's part of the language anyway. That way you don't run into weird array index issues and the array itself will always keep track of turn order. You'll just need to write a small comparator function that uses the Character's "turn timer" member variable as the basis of comparison.A priority queue is overkill for the typical number of characters in an RPG battle. Simply put them in a regular array and sort. --- https://imgur.com/a/FU9H8 - https://imgur.com/ZkQRDsR.png - https://imgur.com/2x2gtgP.jpg ... Copied to Clipboard! |
Topic List | Page List: 1 |