Пример #1
0
        public static void PlayGlassSound(EngineActionType type)
        {
            float typeValue = (int)type;

            typeValue /= 8f;
            sfxGlass[_random.Next(0, sfxGlass.Count)].Play(Save.SoundVolume, -1 + typeValue * 1.0f, 0);
        }
        private TextureRegion2D GetTextureForAction(EngineActionType action)
        {
            switch (action)
            {
            case EngineActionType.Special: return(Gfx.sheet_Ingame["input_glyph_10"]);

            case EngineActionType.MoveN: return(Gfx.sheet_Ingame["input_glyph_11"]);

            case EngineActionType.MoveNE: return(Gfx.sheet_Ingame["input_glyph_12"]);

            case EngineActionType.MoveE: return(Gfx.sheet_Ingame["input_glyph_13"]);

            case EngineActionType.MoveSE: return(Gfx.sheet_Ingame["input_glyph_14"]);

            case EngineActionType.MoveS: return(Gfx.sheet_Ingame["input_glyph_15"]);

            case EngineActionType.MoveSW: return(Gfx.sheet_Ingame["input_glyph_16"]);

            case EngineActionType.MoveW: return(Gfx.sheet_Ingame["input_glyph_17"]);

            case EngineActionType.MoveNW: return(Gfx.sheet_Ingame["input_glyph_18"]);

            default:
                throw new ArgumentOutOfRangeException(nameof(action), action, null);
            }
        }
Пример #3
0
 private void EngineAction(EngineRequest request, EngineActionType actionType, bool willSendProgress)
 {
     if (willSendProgress)
         WriteLine("GetUser.EngineAction - Type: " + actionType.ToString() + " Expecting Progress Reports.");
     else
         WriteLine("GetUser.EngineAction - Type: " + actionType.ToString() + " NOT Expecting Progress Reports.");
 }
Пример #4
0
        public static void PlayGlassReverseSound(EngineActionType type)
        {
            float typeInt = (int)type;

            typeInt /= 8f;
            sfxGlassReverse[_random.Next(0, sfxGlassReverse.Count)].Play(Save.SoundVolume, -1 + typeInt * 1.0f, 0);
        }
 public void AddAction(EngineActionType engineActionType, int count = 1)
 {
     while (count-- > 0)
     {
         Actions.Add(engineActionType);
     }
 }
 private void EngineAction(EngineRequest request, EngineActionType actionType, bool willSendProgress)
 {
     if (willSendProgress)
         WriteLine("ModifyResourceUsageRightsTemplate.EngineAction - Type: " + actionType.ToString() + " Expecting Progress Reports.");
     else
         WriteLine("ModifyResourceUsageRightsTemplate.EngineAction - Type: " + actionType.ToString() + " NOT Expecting Progress Reports.");
 }
Пример #7
0
 private void EngineAction(EngineRequest request, EngineActionType actionType, bool willSendProgress)
 {
     if (willSendProgress)
     {
         WriteLine("SearchTest.EngineAction - Type: " + actionType.ToString() + " Expecting Progress Reports.");
     }
     else
     {
         WriteLine("SearchTest.EngineAction - Type: " + actionType.ToString() + " NOT Expecting Progress Reports.");
     }
 }
Пример #8
0
 private void EngineAction(EngineRequest request, EngineActionType actionType, bool willSendProgress)
 {
     if (willSendProgress)
     {
         WriteLine("ModifyResourceUsageRightsTemplate.EngineAction - Type: " + actionType.ToString() + " Expecting Progress Reports.");
     }
     else
     {
         WriteLine("ModifyResourceUsageRightsTemplate.EngineAction - Type: " + actionType.ToString() + " NOT Expecting Progress Reports.");
     }
 }
Пример #9
0
 private void EngineAction(EngineRequest request, EngineActionType actionType, bool willSendProgress)
 {
     if (willSendProgress)
     {
         WriteLine("ModifyGlobalPermissions.EngineAction - Type: " + actionType.ToString() + " Expecting Progress Reports.");
     }
     else
     {
         WriteLine("ModifyGlobalPermissions.EngineAction - Type: " + actionType.ToString() + " NOT Expecting Progress Reports.");
     }
 }
Пример #10
0
 protected void TriggerOnActionChanged(EngineActionType actionType, bool willSendProgress)
 {
     try
     {
         if (OnActionChanged != null) OnActionChanged(this, actionType, willSendProgress);
     }
     catch (System.Exception e)
     {
         Logger.Storage.Error("An exception occurred while calling the OnActionChanged event.", e);
         throw;
     }
 }
        public RendererActionBrick(EngineActionType action, int index, int bricksCount = 0)
        {
            Action   = action;
            _texture = GetTextureForAction(action);
            _x       = S.ActionInputClippingRectangle.Right + _texture.Width * index;
            _y       = S.ActionGlassLeftmostY;

            if (bricksCount > 0)
            {
                var actionsWidth = (_texture.Width + S.ActionGlassSpacing) * bricksCount - 6;
                _x = S.ActionInputClippingRectangle.X + (S.ActionInputClippingRectangle.Width - actionsWidth) / 2f + index * (_texture.Width + S.ActionGlassSpacing);
            }
        }
        private static void AddAction(EngineParserState state, EngineActionType actionType)
        {
            if (state.LastNumberGroup < 0)
            {
                return;
            }
            if (state.LastNumberGroup == 0)
            {
                state.LastNumberGroup = 1;
            }

            state.AddAction(actionType, state.LastNumberGroup);
            state.LastNumberGroup = 0;
        }
Пример #13
0
 protected void TriggerOnActionChanged(Tasks.Base task, EngineActionType actionType, bool willSendProgress)
 {
     try
     {
         if (OnActionChanged != null)
         {
             OnActionChanged(this, task, actionType, willSendProgress);
         }
     }
     catch (System.Exception e)
     {
         Logger.Storage.Error("An exception occurred while calling the OnActionChanged event.", e);
         throw;
     }
 }
Пример #14
0
 private Action GetSfxReverseSoundAction(EngineActionType actionType)
 {
     return(() => Sfx.PlayGlassReverseSound(actionType));
 }
Пример #15
0
 /// <summary>
 ///     Performs the engine actions.
 /// </summary>
 /// <param name = "crawlRequests">The crawl requests.</param>
 /// <param name = "engineActionType">Type of the engine action.</param>
 /// <param name = "arachnodeDAO">The arachnode DAO.</param>
 public abstract void PerformEngineActions(PriorityQueue <CrawlRequest <TArachnodeDAO> > crawlRequests, EngineActionType engineActionType, IArachnodeDAO arachnodeDAO);
Пример #16
0
 protected EngineAction(EngineActionType type)
 {
     this.Type = type;
 }
Пример #17
0
        /// <summary>
        ///     Performs the engine actions.
        /// </summary>
        /// <param name = "crawlRequests">The crawl requests.</param>
        /// <param name = "engineActionType">Type of the engine action.</param>
        /// <param name = "arachnodeDAO">The arachnode DAO.</param>
        public override void PerformEngineActions(PriorityQueue <CrawlRequest <TArachnodeDAO> > crawlRequests, EngineActionType engineActionType, IArachnodeDAO arachnodeDAO)
        {
            switch (engineActionType)
            {
            case EngineActionType.PreGetCrawlRequests:
                foreach (List <AEngineAction <TArachnodeDAO> > engineActions in _preGetCrawlRequestsActions.Values)
                {
                    foreach (AEngineAction <TArachnodeDAO> engineAction in engineActions)
                    {
                        if (engineAction.IsEnabled)
                        {
                            try
                            {
                                engineAction.PerformAction(crawlRequests, arachnodeDAO);
                            }
                            catch (Exception exception)
                            {
                                arachnodeDAO.InsertException(null, null, exception, false);
                            }
                        }
                    }
                }
                break;

            case EngineActionType.PostGetCrawlRequests:
                foreach (List <AEngineAction <TArachnodeDAO> > engineActions in _postGetCrawlRequestsActions.Values)
                {
                    foreach (AEngineAction <TArachnodeDAO> engineAction in engineActions)
                    {
                        if (engineAction.IsEnabled)
                        {
                            try
                            {
                                engineAction.PerformAction(crawlRequests, arachnodeDAO);
                            }
                            catch (Exception exception)
                            {
                                arachnodeDAO.InsertException(null, null, exception, false);
                            }
                        }
                    }
                }
                break;
            }
        }