public TheGame(int numberOfPlayers, int numberOfSnacks) { NumberOfPlayers = numberOfPlayers; for (int i = 0; i < numberOfPlayers; i++) { Snakes.Add(new Snake(40, 20, i)); } for (int i = 0; i < numberOfSnacks; i++) { Snacks.Add(new Snack()); } }
public void AddSnack(Snack snack) { if (snack != null) { var apply = snack.ApplyLightPromotion(snack); Snacks.Add(snack); if (apply) { TotalPrice += (snack.TotalPrice - (snack.TotalPrice * 0.1)); } else { TotalPrice += snack.TotalPrice; } } }
public void AddItem(Snack snack) { //add is the new push Snacks.Add(snack.Name, snack); }
public void AddItem(Snack snack) { Snacks.Add(snack); }