Using SVars for AI deck building

I was adding some DeckHints for some recent cards based on this recent discussion. I started adding hints for the Allies in BFZ, and realized that every card I was adding it to already had "SVar:BuffedBy:Ally" in the card script. It seemed silly to add something extra when the information was already being coded into the cards.
So I was wondering if it would work to use that SVar (and possibly others) to more easily figure out what cards have synergy with each other when the AI is building the limited decks. The only problem I ran into is not my lack of understanding the different types of Card objects and where I can actually get the SVar information, and not fully understanding all of what SVars are used for. I ended up having to write something like this in LimitedDeckBuilder:
Also, this idea of using BuffedBy works great for Ally because it's a creature type. But I found out that BuffedBy can contain lots of different things, like "Color.Colorless" or "Land" or "Creature". Some of those might be useful too for figuring out card synergies, but how do I tell what kind of thing the value is referring to? I.e., in the code, is there a way to know that "BuffedBy:Ally" is referring to a creature type, and "BuffedBy:Color.Colorless" is referring to a color?
So I was wondering if it would work to use that SVar (and possibly others) to more easily figure out what cards have synergy with each other when the AI is building the limited decks. The only problem I ran into is not my lack of understanding the different types of Card objects and where I can actually get the SVar information, and not fully understanding all of what SVars are used for. I ended up having to write something like this in LimitedDeckBuilder:
- Code: Select all
Iterable<Map.Entry<String, String>> vars = cardToAdd.getRules().getMainPart().getVariables();
for (Map.Entry<String, String> var : vars) {
if (var.getKey().equals("BuffedBy")) {
Also, this idea of using BuffedBy works great for Ally because it's a creature type. But I found out that BuffedBy can contain lots of different things, like "Color.Colorless" or "Land" or "Creature". Some of those might be useful too for figuring out card synergies, but how do I tell what kind of thing the value is referring to? I.e., in the code, is there a way to know that "BuffedBy:Ally" is referring to a creature type, and "BuffedBy:Color.Colorless" is referring to a color?