I'm trying to call two functions, ShowInventories and DoTransaction. Both of these functions are inside a '#if'. I'm not sure what a '#if' means or if there is a specif way to call a function from it.
I've simply tried to call the functions ShowInventories and DoTransaction and then running what I need to through them like this:
ShowInventories(Thing being sent through);
DoTransaction(Thing being sent through);
The #if statement looks like this:
#if INVENTORY
static void ShowInventories(string playerName, Inventory playerInv, Inventory storeInv)
{
Console.SetCursorPosition(2, 2);
Console.Write(playerName + "'s inventory: ");
playerInv.DisplayInventory(4, 3);
Console.SetCursorPosition(39, 2);
Console.Write("The Store's inventory: ");
storeInv.DisplayInventory(41, 3);
}
static void DoTransaction(string playerName, Inventory playerInv, Inventory storeInv, bool buy)
{
if (buy)
{
DoBuy(playerName, playerInv, storeInv);
}
else
{
DoSell(playerName, playerInv, storeInv);
}
}
...
#endif
I didn't know if the code inside of two function matters but I put them in either way. They are calling other functions somewhere else in the code but I'm not sure that it matters to include.
The problem is that it is telling me that 'both function do not exist in the current context' even through the '#if' is right underneath this code. I also do not understand what '#if' is, if someone could help clear things up for me I would really appreciate it. Thank you in advanced.