private static void InitAgentCoins(List <String> Coins) { agentCoins = new Dictionary <string, AgentCoin>(); for (int i = 0; i < Coins.Count; i++) { string coinType = Coins[i]; agentCoins[coinType] = new AgentCoin(Coins[i]); } }
private void SellCoin(AgentCoin coin, double amount) { double transactionValue; transactionValue = coin.lastDealPrice * amount; availableBuyingPower += transactionValue; coin.numOwned -= amount; Console.WriteLine("Sell " + amount + " " + coin.type + " at $" + transactionValue); }
private void BuyCoin(AgentCoin coin, double amount) { double transactionValue; coin.buyPrice = coin.lastDealPrice; coin.numOwned += amount; transactionValue = amount * coin.buyPrice; availableBuyingPower -= transactionValue; Console.WriteLine("Buy " + amount + " " + coin.type + " at $" + transactionValue); }