示例#1
0
 /// <summary>
 /// Ensures that the duel does not go longer than the maximum time limit
 /// </summary>
 /// <param name="duelTimer">Duel Timer to stop when the time is reached</param>
 /// <param name="duelLength">the time limit</param>
 public Countdown(DuelTimer timer)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Timer     = timer;
     m_StartTime = DateTime.Now;
     m_EndTime   = m_StartTime + TimeSpan.FromSeconds(4.0);
 }
示例#2
0
 /// <summary>
 /// Ensures that the duel does not go longer than the maximum time limit
 /// </summary>
 /// <param name="duelTimer">Duel Timer to stop when the time is reached</param>
 /// <param name="duelLength">the time limit</param>
 public DuelLimit(DuelTimer duelTimer, TimeSpan duelLength)
     : base(TimeSpan.FromSeconds(0.0), TimeSpan.FromMinutes(1.0))
 {
     m_StartTime = DateTime.Now;
     m_EndTime   = m_StartTime + duelLength;
 }
示例#3
0
 /// <summary>
 /// Ensures that the duel does not go longer than the maximum time limit
 /// </summary>
 /// <param name="duelTimer">Duel Timer to stop when the time is reached</param>
 /// <param name="duelLength">the time limit</param>
 public Countdown(DuelTimer timer)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Timer = timer;
     m_StartTime = DateTime.Now;
     m_EndTime = m_StartTime + TimeSpan.FromSeconds(4.0);
 }
示例#4
0
 /// <summary>
 /// Ensures that the duel does not go longer than the maximum time limit
 /// </summary>
 /// <param name="duelTimer">Duel Timer to stop when the time is reached</param>
 /// <param name="duelLength">the time limit</param>
 public DuelLimit(DuelTimer duelTimer, TimeSpan duelLength)
     : base(TimeSpan.FromSeconds(0.0), TimeSpan.FromMinutes(1.0))
 {
     m_StartTime = DateTime.Now;
     m_EndTime = m_StartTime + duelLength;
 }
示例#5
0
        /// <summary>
        /// Handles the Gump's responses
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="info"></param>
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            m_InTime.Stop();

            switch (info.ButtonID)
            {
                case 0:
                    {
                        m_Stone.refreshDuel();
                        break;
                    }
                case 1:
                    {
                        if (m_Acceptor.BankBox.TotalGold < (m_Stone.Wager))
                        {
                            m_Acceptor.SendMessage("You have insufficient funds.");
                            m_Stone.refreshDuel();
                        }
                        else
                        {
                            DuelTimer timer = new DuelTimer(m_Requester, m_Acceptor, m_Stone);
                            timer.Start();
                        }
                        break;
                    }
            }
        }