So I am making a game with a similar content progression to Clash Royale. Essentially u have ranking points (Identified as Trophies), and the number of trophies you have will determine what content you will have access to in the game. So for example every 100 ranking points, you will be able to find new types of cards in chests, new chests in general or new maps. In my game, I want it to be somewhat similar, but I also have some other data that changes based on rank points that is more specific to my game, such as army supply. I'm trying to figure out how I can implement this in a manageable way.
Maybe this is overkill, but this is my design so far:
Basically I have my RankContentItemBase class which has a ranking points int and an IsUnlocked method that returns whether or not the passed in rank is > than the rank passed in. Then I extend this with classes with classes that add the data type I wanna work with (Int, Troop, Map, w/e).
I then have a Generic base container class that has a method for getting all unlocked item in the list of T contents that is extended to contain the concrete RankUnlockItembase types.
I've basically structured things this way so it's easy for me to add new types of items that I want unlocked by rank without having to do much work. Also it prevents things from being coupled together.
Just curious what ppl think of this setup, and what kinda setup you would go with? One concern I have with this design was that if I wanted to see whether a troop was unlocked or not, I can't just say troop.IsUnlocked(). Instead I have to create a new means of determining whether or not a troop is unlocked yet, like for example maybe a method on the RankUnlockedTroopContainer that determines this. Maybe this is ok? I feel like I'm sacrificing simplicity for the sake of maintainability/flexibility.