コード例 #1
0
 /// <summary>
 /// Create a new factory
 /// </summary>
 /// <param name="versionInformationUrl">The url to get the version information from</param>
 /// <param name="patch">The name of the patch file to get</param>
 /// <param name="speedMode">The speed mode to use</param>
 public LaunchGameFactory(
     string versionInformationUrl,
     string patch,
     SpeedModes speedMode
     )
     : this(versionInformationUrl, AvailablePatches.HistoryEdition, speedMode)
 {
     Enum.TryParse(patch, out patchName);
 }
コード例 #2
0
 /// <summary>
 /// Create a new factory
 /// </summary>
 /// <param name="versionInformationUrl">The url to get the version information from</param>
 /// <param name="patch">The name of the patch file to get</param>
 /// <param name="speedMode">The speed mode to use</param>
 public LaunchGameFactory(
     string versionInformationUrl,
     AvailablePatches patch,
     SpeedModes speedMode
     )
 {
     this.versionInformationUrl = versionInformationUrl;
     patchName      = patch;
     this.speedMode = speedMode;
 }
コード例 #3
0
 private void ChangeMode(AIModes mode, SpeedModes speed)
 {
     foreach (Player player in Players)
     {
         AI ghost = player as AI;
         if (ghost != null)
         {
             ghost.ChangeMode(mode, speed);
         }
     }
 }
コード例 #4
0
        /// <inheritdoc/>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            SpeedModes mode      = SpeedModes.Unknown;
            bool       realValue = (bool)value;

            if (realValue && parameter is string parameterAsString)
            {
                Enum.TryParse(parameterAsString, out mode);
            }
            return(mode);
        }
コード例 #5
0
 internal void UpdateEnergyPerSecond(SpeedModes currentMode)
 {
     if (currentMode != SpeedModes.Off)
     {
         CreationTime = Convert.ToSingle(currentMode);
         EnergyConsumptionPerSecond = _mono.EnergyCost / CreationTime;
     }
     else
     {
         EnergyConsumptionPerSecond = 0f;
     }
 }
コード例 #6
0
 public void UpdateEnergyPerSecond(SpeedModes currentMode)
 {
     if (currentMode != SpeedModes.Off)
     {
         CreationTime = Convert.ToSingle(currentMode);
         EnergyConsumptionPerSecond = QPatch.Configuration.Config.EnergyCost / CreationTime;
     }
     else
     {
         EnergyConsumptionPerSecond = 0f;
     }
 }
コード例 #7
0
ファイル: Red.cs プロジェクト: SebaWnek/WnekoPacMan
 public override void ChangeSpeed(SpeedModes mode)
 {
     base.ChangeSpeed(mode);
     if (mode == SpeedModes.Normal)
     {
         if (isElroy1)
         {
             speedMode     = SpeedModes.Elroy1;
             speedModifier = Speeds[SpeedModes.Elroy1];
         }
         else if (isElroy2)
         {
             speedMode     = SpeedModes.Elroy2;
             speedModifier = Speeds[SpeedModes.Elroy2];
         }
     }
 }
コード例 #8
0
        private SpeedModes speedMode;                     //采集速度模式


        /// <summary>
        /// 构造函数
        /// </summary>
        public SpiderSetting()
        {
            this.maxDepth        = 5;
            this.requestTimeout  = 0;
            this.iOTimeout       = 0;
            this.readBufferSize  = 1024;
            this.crawlThreads    = 1;
            this.processThreads  = 1;
            this.userAgent       = DefaultUserAgent;
            this.referer         = "";
            this.requestEncoding = Encoding.Default;

            this.memLimitSize = 102400;
            this.depositePath = "";

            this.speedMode = SpeedModes.Normal;

            this.contentHandlers = new ContentHandlerCollection();
        }
コード例 #9
0
ファイル: TempHum2Click.cs プロジェクト: valoni/MBN-TinyCLR
        /// <summary>
        /// Sets the mechanism to measure the temperature and humidity with.
        /// </summary>
        /// <param name="operatingMode">The TempHum2 Click operates in two modes of operation. Hold and NoHold modes. See <see cref="OperatingModes"/> for an explanation of each type.</param>
        /// <param name="speedMode">The TempHum2 Click operates has two speed modes. Normal and Fast mode.  See <see cref="SpeedModes"/> for an explanation of each type.</param>
        public void SetMode(OperatingModes operatingMode, SpeedModes speedMode)
        {
            _speedMode     = speedMode;
            _operatingMode = operatingMode;

            switch (_speedMode)
            {
            case SpeedModes.Normal when _operatingMode == OperatingModes.Hold:
            {
                _dataRegister = Si7034_CMD_READ_TEMPHUM_HOLDMODE_NORMAL_MODE;
                break;
            }

            case SpeedModes.Normal when _operatingMode == OperatingModes.NoHold:
            {
                _dataRegister = Si7034_CMD_READ_TEMPHUM_NONHOLDMODE_NORMAL_MODE;
                break;
            }

            case SpeedModes.Fast when _operatingMode == OperatingModes.Hold:
            {
                _dataRegister = Si7034_CMD_READ_TEMPHUM_HOLDMODE_FAST_MODE;
                break;
            }

            case SpeedModes.Fast when _operatingMode == OperatingModes.NoHold:
            {
                _dataRegister = Si7034_CMD_READ_TEMPHUM_NONHOLDMODE_FAST_MODE;
                break;
            }

            default:
            {
                _dataRegister = Si7034_CMD_READ_TEMPHUM_HOLDMODE_NORMAL_MODE;
                break;
            }
            }
        }
コード例 #10
0
 protected SpiderSetting(SerializationInfo info, StreamingContext context)
 {
     this.name            = info.GetString("name");
     this.startUrl        = info.GetValue("startUrl", typeof(StartUrl)) as StartUrl;
     this.maxDepth        = info.GetInt16("maxDepth");
     this.allowRedirect   = info.GetBoolean("allowRedirect");
     this.requestTimeout  = info.GetInt32("requestTimeout");
     this.iOTimeout       = info.GetInt32("iOTimeout");
     this.readBufferSize  = info.GetInt32("readBufferSize");
     this.crawlThreads    = info.GetInt16("crawlThreads");
     this.processThreads  = info.GetInt16("processThreads");
     this.proxy           = info.GetValue("proxy", typeof(IWebProxy)) as IWebProxy;
     this.userAgent       = info.GetString("userAgent");
     this.referer         = info.GetString("referer");
     this.cookies         = info.GetValue("cookies", typeof(CookieCollection)) as CookieCollection;
     this.requestEncoding = info.GetValue("requestEncoding", typeof(Encoding)) as Encoding;
     this.urlExtractor    = info.GetValue("urlExtractor", typeof(UrlExtractor)) as UrlExtractor;
     this.contentHandlers = info.GetValue("contentHandlers", typeof(ContentHandlerCollection)) as ContentHandlerCollection;
     this.logger          = info.GetValue("logger", typeof(ILogger)) as ILogger;
     this.memLimitSize    = info.GetInt32("memLimitSize");
     this.depositePath    = info.GetString("depositePath");
     this.speedMode       = (SpeedModes)info.GetValue("speedMode", typeof(SpeedModes));
 }
コード例 #11
0
 /// <summary>
 /// Create a new instance of this class
 /// </summary>
 /// <param name="speedMode">The speed mode to use</param>
 public PatchGameSpeedTask(SpeedModes speedMode)
 {
     abortOnError   = true;
     this.speedMode = speedMode;
 }
コード例 #12
0
        private string userAgent; //User-Agent

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 构造函数
        /// </summary>
        public SpiderSetting()
        {
            this.maxDepth = 5;
            this.requestTimeout = 0;
            this.iOTimeout = 0;
            this.readBufferSize = 1024;
            this.crawlThreads = 1;
            this.processThreads = 1;
            this.userAgent = DefaultUserAgent;
            this.referer = "";
            this.requestEncoding = Encoding.Default;

            this.memLimitSize = 102400;
            this.depositePath = "";

            this.speedMode = SpeedModes.Normal;

            this.contentHandlers = new ContentHandlerCollection();
        }
コード例 #13
0
 protected SpiderSetting(SerializationInfo info, StreamingContext context)
 {
     this.name = info.GetString("name");
     this.startUrl = info.GetValue("startUrl", typeof(StartUrl)) as StartUrl;
     this.maxDepth = info.GetInt16("maxDepth");
     this.allowRedirect = info.GetBoolean("allowRedirect");
     this.requestTimeout = info.GetInt32("requestTimeout");
     this.iOTimeout = info.GetInt32("iOTimeout");
     this.readBufferSize = info.GetInt32("readBufferSize");
     this.crawlThreads = info.GetInt16("crawlThreads");
     this.processThreads = info.GetInt16("processThreads");
     this.proxy = info.GetValue("proxy", typeof(IWebProxy)) as IWebProxy;
     this.userAgent = info.GetString("userAgent");
     this.referer = info.GetString("referer");
     this.cookies = info.GetValue("cookies", typeof(CookieCollection)) as CookieCollection;
     this.requestEncoding = info.GetValue("requestEncoding", typeof(Encoding)) as Encoding;
     this.urlExtractor = info.GetValue("urlExtractor", typeof(UrlExtractor)) as UrlExtractor;
     this.contentHandlers = info.GetValue("contentHandlers", typeof(ContentHandlerCollection)) as ContentHandlerCollection;
     this.logger = info.GetValue("logger", typeof(ILogger)) as ILogger;
     this.memLimitSize = info.GetInt32("memLimitSize");
     this.depositePath = info.GetString("depositePath");
     this.speedMode = (SpeedModes)info.GetValue("speedMode",typeof(SpeedModes));
 }
コード例 #14
0
 public virtual void ChangeSpeed(SpeedModes mode)
 {
     speedMode     = mode;
     speedModifier = Speeds[mode];
 }
コード例 #15
0
 /// <summary>
 /// Constructs a new GCodeLine object with the specified parameters.
 /// </summary>
 /// <param name="x">The position to move to on the X axis</param>
 /// <param name="y">The position to move to on the Y axis</param>
 /// <param name="z">The position to move to on the Z axis</param>
 /// <param name="speed">The feed-rate per minute of the move between the starting point and ending point</param>
 /// <param name="extrude">The amount to extrude between the starting point and ending point</param>
 /// <param name="mode">Rapid linear Move (G0, Fast) and Linear Move (G1, Slow)</param>
 public GCodeLine(double?x = null, double?y = null, double?z = null, double?speed = null, double?extrude = null, SpeedModes mode = SpeedModes.Slow)
 {
     this.x         = x;
     this.y         = y;
     this.z         = z;
     this.f         = speed;
     this.e         = extrude;
     this.SpeedMode = mode;
 }
コード例 #16
0
 /// <summary>
 /// Create a new instance of this data container
 /// </summary>
 /// <param name="patch">The patch to use for launching</param>
 /// <param name="speed">The speed to use for launching</param>
 public LaunchGameData(AvailablePatches patch, SpeedModes speed)
 {
     Patch = patch;
     Speed = speed;
 }