private void SpawnRandomCart() { if (!_spawn) { if (_random.Next(4) == 2) { //If the integer is equal to 2, Spawn a cart. Else, keep waiting. _spawn = true; } } int letter = _random.Next(1, 4); if (_spawn) { switch (letter) { case 1: _main.AddCart(_main.GetWarehouse(Symbols.WarehouseA).SpawnCart()); _spawn = false; break; case 2: _main.AddCart(_main.GetWarehouse(Symbols.WarehouseB).SpawnCart()); _spawn = false; break; case 3: _spawn = false; _main.AddCart(_main.GetWarehouse(Symbols.WarehouseC).SpawnCart()); break; } } }