Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the AudioHelper class.
        /// </summary>
        /// <param name="communicationHelper">
        /// Объект, упращающий взаимодействие с роботом.
        /// </param>
        /// <param name="controlSettings">
        /// Опции управления роботом.
        /// </param>
        public AudioHelper(UdpCommunicationHelper communicationHelper, ControlSettings controlSettings)
        {
            if (communicationHelper == null)
            {
                throw new ArgumentNullException("communicationHelper");
            }

            if (controlSettings == null)
            {
                throw new ArgumentNullException("controlSettingsHelper");
            }

            this.communicationHelper = communicationHelper;
            this.controlSettings = controlSettings;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the GameRobot class.
        /// </summary>
        public GameRobot()
        {
            this.IsFixedTimeStep = false;
            this.graphics = new GraphicsDeviceManager(this);
            this.graphics.SynchronizeWithVerticalRetrace = false;

            // this.graphics.IsFullScreen = true;
            // this.IsMouseVisible = false;
            Content.RootDirectory = "Content";

            this.controlSettingsHelper = new ControlSettingsHelper();
            this.controlSettingsHelper.Load();

            this.communicationHelper = new UdpCommunicationHelper(
                this.controlSettingsHelper.Settings.RoboHeadAddress,
                this.controlSettingsHelper.Settings.UdpSendPort,
                this.controlSettingsHelper.Settings.UdpReceivePort,
                this.controlSettingsHelper.Settings.SingleMessageRepetitionsCount);

            this.flashlightHelper = new FlashlightHelper(this.communicationHelper);
            this.driveHelper = new DriveHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
            this.lookHelper = new LookHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
            this.moodHelper = new MoodHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
            this.gunHelper = new GunHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
            this.videoHelper = new VideoHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
            this.audioHelper = new AudioHelper(this.communicationHelper, this.controlSettingsHelper.Settings);
        }