/// <summary> /// Initializes a new instance of the class. Initializes the: communication interface; main window interface; cyclic queues; max/min values and /// read/write locks. /// </summary> /// <param name="communicationInterface">Reference to the communication interface used to communicate with the target hardware.</param> /// <param name="cyclicQueueRecordSize">The required size of the cyclic buffer used to record watch data.</param> /// <param name="cyclicQueueLogSize">The required size of the cyclic buffer used to log watch data.</param> /// <param name="formWatchView">Reference to the form that called this form.</param> public ThreadPollWatch(ICommunicationWatch communicationInterface, int cyclicQueueRecordSize, int cyclicQueueLogSize, FormViewWatch formWatchView) { m_CommunicationInterface = communicationInterface; Debug.Assert(m_CommunicationInterface != null); m_FormViewWatch = formWatchView; Debug.Assert(m_FormViewWatch != null, "ThreadPollWatch.Ctor() - [m_FormViewWatch != null]"); m_CyclicQueueRecord = new CyclicQueue <WatchFrame_t>(cyclicQueueRecordSize); m_CyclicQueueLog = new CyclicQueue <WatchFrame_t>(cyclicQueueLogSize); m_MutexPause = new Mutex(); m_MutexPauseFeedback = new Mutex(); m_MutexCommunicationFault = new Mutex(); m_MutexRecord = new Mutex(); m_MutexAutoScaleWatchValues = new Mutex(); #region - [AutoScale] - m_AutoScaleWatchValues = new AutoScale_t[Parameter.WatchSize]; #endregion - [AutoScale] - m_PacketCount = 0; m_PollScheduler = new PollScheduler(); m_ReadTimeoutCountdown = ReadTimeoutCountdown; }
public GameStateMachine(IEnumerable <Role> roles) { LinkedList <GameState> existStates = new LinkedList <GameState>(); existStates.AddLast(GameState.HelloGame); existStates.AddLast(GameState.DayDiscussion); existStates.AddLast(GameState.EveningVoting); existStates.AddLast(GameState.MafiaStep); if (roles.Select(t => t is ManiacRole).Any()) { existStates.AddLast(GameState.ManiacStep); } if (roles.Select(t => t is DoctorRole).Any()) { existStates.AddLast(GameState.DoctorStep); } if (roles.Select(t => t is ComissarRole).Any()) { existStates.AddLast(GameState.ComissarStep); } stateQueue = new CyclicQueue <GameState>(existStates); }
/// <summary> /// Initializes a new instance of the class. Initializes the: communication interface; main window interface; cyclic queues; max/min values and /// read/write locks. /// </summary> /// <param name="communicationInterface">Reference to the communication interface used to communicate with the target hardware.</param> /// <param name="cyclicQueueRecordSize">The required size of the cyclic buffer used to record watch data.</param> /// <param name="cyclicQueueLogSize">The required size of the cyclic buffer used to log watch data.</param> /// <param name="formWatchView">Reference to the form that called this form.</param> public ThreadPollWatch(ICommunicationWatch communicationInterface, int cyclicQueueRecordSize, int cyclicQueueLogSize, FormViewWatch formWatchView) { m_CommunicationInterface = communicationInterface; Debug.Assert(m_CommunicationInterface != null); m_FormViewWatch = formWatchView; Debug.Assert(m_FormViewWatch != null, "ThreadPollWatch.Ctor() - [m_FormViewWatch != null]"); m_CyclicQueueRecord = new CyclicQueue<WatchFrame_t>(cyclicQueueRecordSize); m_CyclicQueueLog = new CyclicQueue<WatchFrame_t>(cyclicQueueLogSize); m_MutexPause = new Mutex(); m_MutexPauseFeedback = new Mutex(); m_MutexCommunicationFault = new Mutex(); m_MutexRecord = new Mutex(); m_MutexAutoScaleWatchValues = new Mutex(); #region - [AutoScale] - m_AutoScaleWatchValues = new AutoScale_t[Parameter.WatchSize]; #endregion - [AutoScale] - m_PacketCount = 0; m_PollScheduler = new PollScheduler(); m_ReadTimeoutCountdown = ReadTimeoutCountdown; }
public AIPlayer() { this.treasureChances = new List<TreasureChanceInfo> (); this.lastVisitedLocations = new CyclicQueue<GridLocation> (NumberRememberdLastLocations); }