I'm trying to create cards for a ccg/tcg that are completely "data-driven" from an xml/json/external file. I've read multiple articles on this issue already, even here on stack exchange, but i can't figure out how to actually code this. I have a simple example:
My two cards have the following abilities
1) "Increase the value of all adjacent red cards by 1"
2) "Increase the value of this card by the amount of all adjacent red cards"
In my code i have the following functions (pseudo) that i need to accomplish these effects:
Increase(targetCards, byValue) // increases a card's value by another value
FindCards(filter=adjacent) // returns all adjacent cards
FilterCardsBy(filter=isRed) // returns only red cards
Count(targetCards) // counts the number of cards
To create effect 1 i would use the functions like this:
Increase(FilterCards(FindCards(adjacent), isRed), 1);
and to create effect 2 i would use:
Increase(this, Count(FilterCards(FindCards(adjacent), isRed)));
So here's the problem: I have no clue how i can describe these functions in my external file and also i have no clue how i actually tell my functions to work in this combination to achieve the desired effects. Maybe i'm misunderstanding the concept here but as far as i understood and described here i can create some pseudo script/code in my external file that then my code can interpret and execute on. But i feel i somehow missing the middle part where i write code to interpret these commands i'm defining in the external file.
Anyone with experience here that can give me some super simple starter ideas on how to takle this. Especially the part where i can combine several functions into one.