public MainMenuSpawnerManager() : base() { this.stateChanged = true; this.spawnerStateFunction = null; this.stateStackTrace = new Stack<SpawnStateFunction>(); this.configuration = Configuration.getCurrentConfiguration(); }
/// <summary> /// Default constructor /// </summary> /// <param name="sceneBrain">The active scene brain must be passed,in order to allow the spawner to reference it</param> public GameSpawnerManager(GameSceneBrain gameSceneBrain) : base() { this.random = new Random(); currentConfiguration = Configuration.getCurrentConfiguration(); this.gameSceneBrain = gameSceneBrain; this.minChopSpawnCooldownMillis = this.gameSceneBrain.getMinCutCooldown(); this.maxChopSpawnCooldownMillis = this.gameSceneBrain.getMaxCutCooldown(); this.unfriendlyObjCooldown = this.generateNewChopCooldown(); this.lastUnfriendlyObjSpawned = unfriendlyObjCooldown; this.friendlyObjCooldown = random.Next(currentConfiguration.minFriendlyObjectSpawnCooldownTimeMillis, currentConfiguration.maxFriendlyObjectSpawnCoooldownTimeMillis); this.lastFriendlyObjSpawned = 0; this.gameFirstStart = true; }
public GameSceneBrain() { this.currentConfiguration = Configuration.getCurrentConfiguration(); this.gameStartCountdownMillis = currentConfiguration.gameStartCountdownMillis; this.userTracked = false; }
public static Configuration getCurrentConfiguration() { // if not defined deserialize from XML if (_configuration == null) { _configuration = createFromXML(); //if it's still undefined create with default values AND serialize to XML if (_configuration == null) { _configuration = new Configuration(); } //now all attributes are surely assigned: refresh file on disk _configuration.serializeToXML(); } return _configuration; }