예제 #1
0
 public MainMenuSpawnerManager()
     : base()
 {
     this.stateChanged = true;
     this.spawnerStateFunction = null;
     this.stateStackTrace = new Stack<SpawnStateFunction>();
     this.configuration = Configuration.getCurrentConfiguration();
 }
예제 #2
0
        /// <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;
        }
예제 #3
0
 public GameSceneBrain()
 {
     this.currentConfiguration = Configuration.getCurrentConfiguration();
     this.gameStartCountdownMillis = currentConfiguration.gameStartCountdownMillis;
     this.userTracked = false;
 }
예제 #4
0
        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;
        }