public static Bet getBet(String name) { BetImpl bet = (BetImpl)betTable[name]; if (bet == null) { bet = new BetImpl(name); betTable.Add(name, bet); Console.WriteLine("Creating bet name: " + name); } return(bet); }
static void Main(string[] args) { for (int i = 0; i < 10; ++i) { BetImpl bet = (BetImpl)BetFactory.getBet(getRandomName()); bet.setType(getRandomType()); bet.setAmount(getRandomAmount()); bet.makeBet(); } Console.ReadLine(); }