Exemplo n.º 1
0
 public GameRoom(GameConfig config)
 {
     Config = config;
     IsRandom = config.IsRandom;
     State = GameState.Lobby;
     CurrentPlayer = 0;
     LifePoints = new int[2];
     Players = new GameSession[IsTag ? 4 : 2];
     CurPlayers = new GameSession[2];
     IsReady = new bool[IsTag ? 4 : 2];
     m_handResult = new int[2];
     m_timelimit = new int[2];
     m_bonustime = new int[2];
     m_matchResult = new int[3];
     AutoEndTrun = Program.Config.AutoEndTurn;
     Banlist = BanlistManager.GetBanlist(config.LfList);
     m_analyser = new GameAnalyser(this);
     StartTime = DateTime.Now;
     IsOpen = true;
     GameTimer = new GameTimer(this);
     DuleTimer = new System.Timers.Timer(10 * 1000);
     DuleTimer.AutoReset = true;
     DuleTimer.Enabled = true;
     DuleTimer.Elapsed += new System.Timers.ElapsedEventHandler(DuleTimer_Elapsed);
 }
Exemplo n.º 2
0
		/// <summary>
		/// 是否允许断线重连
		/// </summary>
	//	private bool CanPause = false;
		
		public Game(GameRoom room, GameConfig config)
		{
			Config = config;
			State = GameState.Lobby;
			IsMatch = config.Mode == 1;
			IsTag = config.Mode == 2;
			CurrentPlayer = 0;
			LifePoints = new int[2];
			Players = new Player[IsTag ? 4 : 2];
			PlayerNames = new string[IsTag ? 4 : 2];
			CurPlayers = new Player[2];
			IsReady = new bool[IsTag ? 4 : 2];
			m_handResult = new int[2];
			m_timelimit = new int[2];
			m_bonustime = new int[2];
			m_matchResult = new int[3];
			AutoEndTrun = Program.Config.AutoEndTurn;
			Observers = new List<Player>();
			if (config.LfList >= 0 && config.LfList < BanlistManager.Banlists.Count)
				Banlist = BanlistManager.Banlists[config.LfList];
			else if(BanlistManager.Banlists.Count>0){
				Banlist = BanlistManager.Banlists[0];
			}
			m_room = room;
			m_analyser = new GameAnalyser(this);
			yrpName=DateTime.Now.ToString("yyyyMMddHHmmss");
		}
Exemplo n.º 3
0
 public Game(GameRoom room, GameConfig config)
 {
     Config = config;
     State = GameState.Lobby;
     IsMatch = config.Mode == 1;
     IsTag = config.Mode == 2;
     CurrentPlayer = 0;
     LifePoints = new int[2];
     Players = new Player[IsTag ? 4 : 2];
     CurPlayers = new Player[2];
     IsReady = new bool[IsTag ? 4 : 2];
     m_handResult = new int[2];
     m_timelimit = new int[2];
     m_bonustime = new int[2];
     m_matchResult = new int[3];
     Observers = new List<Player>();
     if (config.LfList >= 0 && config.LfList < BanlistManager.Banlists.Count)
         Banlist = BanlistManager.Banlists[config.LfList];
     m_room = room;
     m_analyser = new GameAnalyser(this);
 }