applejacks
applejacks
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
85%. I've never used a sortedlist and it doesn't sound like what you need either
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
ok. I'm moving now. but just test this, I'm like 90% sure I'm right.
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
so if it's an <int, Player> and you pass (2, Apple), (4, Jacks), (3, Tomato soup), the order will be (2, Apple), (3, Tomato soup), (4, Jacks)
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
Add will add your item, then internally sort it's indexes to match the order of your keys
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
no
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
less efficient than what? I'm driving now but I'm pretty sure, if you implement your code as is, insert 5 players in a given order then remove the middle one and add it back in and look at the order of your players. then add the exact same 5 players in a different order, remove the middle and add it back at the end. you'll see the order of the list of your players is the same
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
you want to use a queue with remove at functionality, I'd implement a class that internally has a queue and, when remove at is called in my class, turn the queue into an array to get how many items exist after the index to be removed, dequeue them to a local var, dequeue the one i don't want and requeue them.
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
have you tested what you're trying to do? using a sortedset just means you have some other functionality to maintain the order of your Player list.
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
but then you can't insert at a given index...
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
a sorted list ensures, regardless of the order you add items, the values are sorted by key
103 replies
CC#
Created by Pagano on 7/12/2024 in #help
Custom Made Collection
wait, I'm confused here. you're talking about ensuring the order of insertion via FIFO, and using a sortedlist
103 replies