Inheritance: IDisposable
Beispiel #1
0
		private void CreateGameRules()
		{
			if(_gameRules != null)
			{
				_gameRules.Dispose();
				_gameRules = null;
			}

			string gameType = _serverInfo.GetString("si_gameType");
			
			switch(gameType.ToLower())
			{
				case "deathmatch":
					_gameRules = new Deathmatch();
					break;

				case "tourney":
				case "team dm":
				case "last man":
					throw new Exception(gameType + " gametype not handled");

				default:
					_gameRules = new Singleplayer();
					break;
			}

			// TODO
			/*if ( gameType == GAME_LASTMAN ) {
				if ( !serverInfo.GetInt( "si_warmup" ) ) {
					common->Warning( "Last Man Standing - forcing warmup on" );
					serverInfo.SetInt( "si_warmup", 1 );
				}
				if ( serverInfo.GetInt( "si_fraglimit" ) <= 0 ) {
					common->Warning( "Last Man Standing - setting fraglimit 1" );
					serverInfo.SetInt( "si_fraglimit", 1 );
				}
			}*/
		}
Beispiel #2
0
		private idClip _clip = new idClip(); // collision detection
		#endregion

		#region Constructor
		public idGame()
		{
			idR.Game = this;
			idR.GameEdit = new idGameEdit();

			InitCvars();

			int count = _userInfo.Length;

			for(int i = 0; i < count; i++)
			{
				_userInfo[i] = new idDict();
				_persistentPlayerInfo[i] = new idDict();
			}

			_gameRules = new Singleplayer();

			Clear();
		}