Exemplo n.º 1
0
        private void InitializeAlgorithm()
        {
            BaseAlgorithmInputValues inputValues;

            switch (SelectedAlgorithm)
            {
            case KindOfAlgorithm.CheckAllSolution:
                _algorithm = new CheckAllSolutionsAlgorithm(_individualLength, ClusteredDataObjects);
                break;

            case KindOfAlgorithm.Genetic:
                inputValues = PrepareGeneticInputValues();
                _algorithm  = new GeneticAlgorithm(_individualLength, ClusteredDataObjects, inputValues);
                break;

            case KindOfAlgorithm.TabuSearch:
                inputValues = PrepareTabuSearchInputValues();
                _algorithm  = new TabuSearchAlgorithm(_individualLength, ClusteredDataObjects, inputValues);
                break;

            case KindOfAlgorithm.BeesColony:
                inputValues = PrepareBeesColonyInputValues();
                _algorithm  = new BeesColonyAlgorithm(_individualLength, ClusteredDataObjects, inputValues);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 2
0
    public static void CalcBlendPctByFunc(BaseAlgorithm.EViewTargetBlendFunction inIndirectViewSightFunc, float inIndirectViewSightExp, float DurationPct, out float BlendPct)
    {
        BlendPct = 0f;
        switch (inIndirectViewSightFunc)
        {
        case BaseAlgorithm.EViewTargetBlendFunction.VTBlend_Linear:
            BlendPct = BaseAlgorithm.Lerp(0f, 1f, DurationPct);
            break;

        case BaseAlgorithm.EViewTargetBlendFunction.VTBlend_Cubic:
            BlendPct = BaseAlgorithm.CubicInterp(0f, 0f, 1f, 0f, DurationPct);
            break;

        case BaseAlgorithm.EViewTargetBlendFunction.VTBlend_EaseIn:
            BlendPct = BaseAlgorithm.FInterpEaseIn(0f, 1f, DurationPct, inIndirectViewSightExp);
            break;

        case BaseAlgorithm.EViewTargetBlendFunction.VTBlend_EaseOut:
            BlendPct = BaseAlgorithm.FInterpEaseOut(0f, 1f, DurationPct, inIndirectViewSightExp);
            break;

        case BaseAlgorithm.EViewTargetBlendFunction.VTBlend_EaseInOut:
            BlendPct = BaseAlgorithm.FInterpEaseInOut(0f, 1f, DurationPct, inIndirectViewSightExp);
            break;
        }
    }
Exemplo n.º 3
0
        public Maze(Point coords, Point size, Point startCoords, int tunnelWidth, int wallWidth, int algorithmID, int variant, Func <Point, bool> PeekFunc, Func <Rect, bool> NukeFunc)
        {
            mazeData = new MazeData(coords, size, startCoords, tunnelWidth, wallWidth, variant);

            if (allAlgorithms.Count == 0)
            {
                allAlgorithms.Add(GrowingTree.name, new GrowingTree(PeekFunc, NukeFunc));
                allAlgorithms.Add(Braid.name, new Braid(PeekFunc, NukeFunc));
                allAlgorithms.Add(GTBraided.name, new GTBraided(PeekFunc, NukeFunc));
            }

            switch (algorithmID)
            {
            case 2:
                this.mazeAlgorithm = new Braid(PeekFunc, NukeFunc);
                break;

            case 1:
                this.mazeAlgorithm = new GTBraided(PeekFunc, NukeFunc);
                break;

            default:
                this.mazeAlgorithm = new GrowingTree(PeekFunc, NukeFunc);
                break;
            }
        }
Exemplo n.º 4
0
        //----------------------------------------------------------------------------------------------------------------------------------------

        private void onNextPlayer(Object aSender, Move aLastMove = null)
        {
            Colors  winner            = Colors.NO_COLOR;
            Boolean isCheckmateOrDraw = isGameOver(ref winner);

            if (isCheckmateOrDraw)
            {
                gameOver(this, winner);
                return;
            }

            if (mIsBoardEnabled)
            {
                mIsBoardEnabled = false;
                setIsEnable(this, mIsBoardEnabled);
            }

            BaseAlgorithm currentAlgorithm = (mCurrentColor == mPlayer1Color ? mPlayer1Algorithm : mPlayer2Algorithm);

            if (!currentAlgorithm.isActive)                // Human
            {
                mIsBoardEnabled = true;
                setIsEnable(this, mIsBoardEnabled);
            }
            else             // Algorithm
            {
                currentAlgorithm.refreshTree(chessBoard, whiteFigures, blackFigures, aLastMove);
                Move lastMove = currentAlgorithm.move(chessBoard, whiteFigures, blackFigures);
                refreshBlackWhiteFigures(lastMove);

                mFigureToMove = lastMove.itemFrom;

                moveFigureTo(lastMove.itemTo);
            }
        }
Exemplo n.º 5
0
 private void DisplayInfoFromSort(BaseAlgorithm <int> sort)
 {
     SortDatarichTextBox.Text  = $"Time: {sort.Time};";
     SortDatarichTextBox.Text += $"\nCount: { sort.Items.Count};";
     SortDatarichTextBox.Text += $"\nSwapCount: { sort.SwapCount};";
     SortDatarichTextBox.Text += $"\nCompareCount: { sort.CompareCount};";
     if (IsBig)
     {
         ChangeValuesAfterSort(sort.Items);
     }
 }
Exemplo n.º 6
0
        public void BaseSortTest()
        {
            //arrange
            var baseSort = new BaseAlgorithm <int>(dataList, "Base");

            //act
            baseSort.Sort();
            //assert
            for (int i = 0; i < count; i++)
            {
                Assert.AreEqual(sortedItems[i], baseSort.Items[i]);
            }
        }
Exemplo n.º 7
0
    public static float FInterpEaseInOut(float A, float B, float Alpha, float Exp)
    {
        float alpha;

        if (Alpha < 0.5f)
        {
            alpha = 0.5f * Mathf.Pow(2f * Alpha, Exp);
        }
        else
        {
            alpha = 1f - 0.5f * Mathf.Pow(2f * (1f - Alpha), Exp);
        }
        return(BaseAlgorithm.Lerp(A, B, alpha));
    }
        public APosterioriAlgorithm(BaseAlgorithm <TObservation, TState> baseAlgorithm) : base(baseAlgorithm)
        {
            c     = new double[T];
            alpha = new Dictionary <TState, double[]>();
            foreach (var state in StateSpace)
            {
                alpha[state] = new double[T];
            }

            beta = new Dictionary <TState, double[]>();
            foreach (var state in StateSpace)
            {
                beta[state] = new double[T];
            }
        }
Exemplo n.º 9
0
        private void BtnClick(BaseAlgorithm <SortedItem> algorithm)
        {
            RefreshItems();

            for (int i = 0; i < algorithm.Items.Count; i++)
            {
                algorithm.Items[i].SetPosition(i);
            }
            panel2.Refresh();

            algorithm.CompareEvent += AlgorithmCompareEvent;
            algorithm.SwopEvent    += AlgorithmSwopEvent;
            algorithm.SetEvent     += AlgorithmSetEvent;
            var time = algorithm.Sort();

            TimeLbl.Text    = "Lead time: " + time.Seconds;
            SwopLbl.Text    = "Number of exchanges: " + algorithm.SwopCount;
            CompareLbl.Text = "Number of comparisons: " + algorithm.CompareCount;
        }
Exemplo n.º 10
0
        public IMidSurface Run(ISolverData solverdata)
        {
            IMidSurface midsurface = new MidSurface();

            maxLengthModel = FindMaxLength(solverdata.GetContours(), 0.01);

            BaseAlgorithm   baseAlgorithm = new BaseAlgorithm();
            List <IMSPoint> msPoints      = baseAlgorithm.Run(solverdata, splitterAccuracy * maxLengthModel,
                                                              detalizerAccuracy * maxLengthModel);

            //Graph msGraph = ConstructGraph(msPoints);
            //msGraph.RemoveCycles(maxCycleSize);

            //List<Point> points = msGraph.GetPath();

            ////Точки для работы
            //List<IMSPoint> new_mspoints = ConvertPointToMSPoint(points, msPoints);

            IJoinMSPoints jointpoints = new JoinMSPoints();

            return(jointpoints.Join(msPoints));
        }
Exemplo n.º 11
0
        private void ButtonCalculate_Click(object sender, EventArgs e)
        {
            Clear();
            var function = comboBoxAlgorithm.SelectedItem;

            if (function == null)
            {
                MessageBox.Show("Fonksiyon boş geçilemez.", "Fonksiyon Seçiniz!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            _functionName = (FunctionNames)function;
            var generation     = (int)numericUpDownGeneration.Value;
            var populationSize = (int)numericUpDownPopulation.Value;

            switch (_algorithmType)
            {
            case AlgorithmTypes.GA:
                _algorithm = new GeneticAlgorithm(_functionName, populationSize, generation)
                             .SetValues(mutationRate: (double)numericUpDownRate.Value);
                break;

            case AlgorithmTypes.PSO:
                //_algorithm = new PSO(_functionName, populationSize, generation)
                //    .SetValues(c1: (double)numericUpDownRate.Value, c2: (double)numericUpDownRate2.Value);
                MessageBox.Show("PSO is WIP", "WIP", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;

            case AlgorithmTypes.ABC:
                _algorithm = new ABC(_functionName, populationSize, generation);
                break;
            }

            _algorithm.AlgorithmStarted += OnAlgoritmStarted;
            _algorithm.AlgorithmEnded   += OnAlgorithmEnded;
            _algorithm.GenerationEnded  += OnGenerationEnded;
            _algorithm.RunAsync();
        }
Exemplo n.º 12
0
 private void TriggerAction(AGE.Action _action, ref PoolObjHandle <ActorRoot> target)
 {
     if (this.attackActor != 0)
     {
         int  num;
         uint objID = target.handle.ObjID;
         if (this.collideCountMap.TryGetValue(objID, out num))
         {
             num++;
             this.collideCountMap[objID] = num;
         }
         else
         {
             this.collideCountMap.Add(objID, 1);
         }
         int num3 = 0;
         if (this.collideTimeMap.TryGetValue(objID, out num3))
         {
             this.collideTimeMap[objID] = this.localTime;
         }
         else
         {
             this.collideTimeMap.Add(objID, this.localTime);
         }
         SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
         if ((refParamObject != null) && (_action.refParams.GetRefParamObject <BaseSkill>("SkillObj") != null))
         {
             refParamObject.EffectCount++;
             if (!this.bTriggerMode)
             {
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_1, false);
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_2, false);
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_3, false);
             }
             else
             {
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_1 > 0))
                 {
                     STriggeredBuffContext inPoint = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_1
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_1, false);
                     }
                 }
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_2 > 0))
                 {
                     STriggeredBuffContext context3 = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_2
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context3))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_2, false);
                     }
                 }
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_3 > 0))
                 {
                     STriggeredBuffContext context4 = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_3
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context4))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_3, false);
                     }
                 }
             }
             if (target != 0)
             {
                 this.hit = true;
                 if ((target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && !this.bHitTargetHero)
                 {
                     this.bHitTargetHero   = true;
                     this.HitTargetHeroPos = target.handle.location;
                 }
                 refParamObject.EffectDir = this.attackActor.handle.forward;
                 bool flag = false;
                 if (!this.bTriggerMode)
                 {
                     bool introduced12 = this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_1, this.bExtraBuff);
                     flag  = introduced12 | this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_2, this.bExtraBuff);
                     flag |= this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_3, this.bExtraBuff);
                 }
                 else
                 {
                     if (this.TargetSkillCombine_1 > 0)
                     {
                         STriggeredBuffContext context5 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_1
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context5))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_1, false);
                         }
                         flag = true;
                     }
                     if (this.TargetSkillCombine_2 > 0)
                     {
                         STriggeredBuffContext context6 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_2
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context6))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_2, false);
                         }
                         flag = true;
                     }
                     if (this.TargetSkillCombine_3 > 0)
                     {
                         STriggeredBuffContext context7 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_3
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context7))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_3, false);
                         }
                         flag = true;
                     }
                 }
                 if (flag)
                 {
                     target.handle.ActorControl.BeAttackHit(this.attackActor);
                 }
             }
             if ((this.bTriggerBullet && (this.BulletActionName != null)) && (this.BulletActionName.Length > 0))
             {
                 refParamObject.AppointType = SkillRangeAppointType.Target;
                 refParamObject.TargetActor = target;
                 this.attackActor.handle.SkillControl.SpawnBullet(refParamObject, this.BulletActionName, false, this.bAgeImmeExcute);
             }
         }
     }
 }
Exemplo n.º 13
0
 public void AddAlgorithm(BaseAlgorithm algorithm)
 {
     _algorithms.Add(algorithm);
 }
Exemplo n.º 14
0
 protected PredictionAlgorithm(BaseAlgorithm <TObservation, TState> baseAlgorithm) : base(baseAlgorithm)
 {
 }
Exemplo n.º 15
0
 public bool IsNear(VInt2 point)
 {
     return(BaseAlgorithm.IsNearlyZero(this.m_point - point, 10));
 }
Exemplo n.º 16
0
 public bool Equals(FowLos.SPolylineVertex rhs)
 {
     return(BaseAlgorithm.IsNearlyZero(this.m_point - rhs.m_point, 10) && this.m_belongBlockId == rhs.m_belongBlockId && this.m_belongSegNoList == rhs.m_belongSegNoList && this.m_bNative == rhs.m_bNative);
 }
Exemplo n.º 17
0
 public void ExploreCellsInternal <TSetCellVisible>(ref TSetCellVisible setCellVisible, VInt2 newSurfPos, VInt3 unitLoc, int surfSightRange, GameFowManager pFowMgr, COM_PLAYERCAMP camp, FowLos.EViewExploringMode ViewExploringMode, bool bDrawDebugLines) where TSetCellVisible : ISetCellVisible
 {
     if (pFowMgr == null || pFowMgr.m_pFieldObj == null)
     {
         return;
     }
     if (ViewExploringMode != FowLos.EViewExploringMode.EViewExploringMode_ShadowCast)
     {
         if (ViewExploringMode == FowLos.EViewExploringMode.EViewExploringMode_DistOnly)
         {
             for (int i = -surfSightRange - 1; i <= surfSightRange + 1; i++)
             {
                 for (int j = -surfSightRange - 1; j <= surfSightRange + 1; j++)
                 {
                     VInt2 b     = new VInt2(i, j);
                     VInt2 inPos = newSurfPos + b;
                     if (pFowMgr.IsInsideSurface(inPos.x, inPos.y) && b.sqrMagnitude < surfSightRange * surfSightRange)
                     {
                         setCellVisible.SetVisible(inPos, camp, true);
                     }
                 }
             }
         }
         else if (ViewExploringMode != FowLos.EViewExploringMode.EViewExploringMode_WatchTower && ViewExploringMode == FowLos.EViewExploringMode.EViewExploringMode_RayCast)
         {
             int sightSqr = surfSightRange * surfSightRange;
             int num      = newSurfPos.x - surfSightRange;
             int num2     = newSurfPos.x + surfSightRange;
             int num3     = newSurfPos.y - surfSightRange;
             int num4     = newSurfPos.y + surfSightRange;
             num  = Mathf.Clamp(num, 0, pFowMgr.m_pFieldObj.NumX - 1);
             num2 = Mathf.Clamp(num2, 0, pFowMgr.m_pFieldObj.NumX - 1);
             num3 = Mathf.Clamp(num3, 0, pFowMgr.m_pFieldObj.NumY - 1);
             num4 = Mathf.Clamp(num4, 0, pFowMgr.m_pFieldObj.NumY - 1);
             byte viewBlockId = pFowMgr.m_pFieldObj.LevelGrid.GetGridCell(newSurfPos).m_viewBlockId;
             FieldObj.SViewBlockAttr sViewBlockAttr = default(FieldObj.SViewBlockAttr);
             pFowMgr.m_pFieldObj.QueryAttr(newSurfPos, out sViewBlockAttr);
             FowLos.CRaycastQuadrant cRaycastQuadrant = new FowLos.CRaycastQuadrant();
             cRaycastQuadrant.min = new VInt2(num, num3);
             cRaycastQuadrant.max = new VInt2(num2, num4);
             if (pFowMgr.m_pFieldObj.ViewBlockArrayImpl != null)
             {
                 List <FowLos.SBlockWalls> .Enumerator enumerator = pFowMgr.m_pFieldObj.ViewBlockArrayImpl.GetEnumerator();
                 while (enumerator.MoveNext())
                 {
                     FowLos.SBlockWalls current = enumerator.get_Current();
                     int areaId = (int)current.m_areaId;
                     DebugHelper.Assert(areaId != 0);
                     FieldObj.SViewBlockAttr sViewBlockAttr2;
                     if (((int)viewBlockId != areaId || sViewBlockAttr.BlockType != 1) && (pFowMgr.m_pFieldObj.GrassBlockView || !pFowMgr.m_pFieldObj.ViewBlockAttrMap.TryGetValue((byte)areaId, ref sViewBlockAttr2) || sViewBlockAttr2.BlockType != 1) && this.ValidateViewBlock(current, cRaycastQuadrant.min.x, cRaycastQuadrant.max.x, cRaycastQuadrant.min.y, cRaycastQuadrant.max.y))
                     {
                         cRaycastQuadrant.viewBlockArrayFinal.Add(current);
                         Dictionary <byte, List <FowLos.SGridWall> > .Enumerator enumerator2 = current.m_wallsHorizontal.GetEnumerator();
                         while (enumerator2.MoveNext())
                         {
                             List <byte> wallsHorizontal = cRaycastQuadrant.wallsHorizontal;
                             KeyValuePair <byte, List <FowLos.SGridWall> > current2 = enumerator2.get_Current();
                             BaseAlgorithm.AddUniqueItem <byte>(wallsHorizontal, current2.get_Key());
                         }
                         enumerator2 = current.m_wallsVertical.GetEnumerator();
                         while (enumerator2.MoveNext())
                         {
                             List <byte> wallsVertical = cRaycastQuadrant.wallsVertical;
                             KeyValuePair <byte, List <FowLos.SGridWall> > current3 = enumerator2.get_Current();
                             BaseAlgorithm.AddUniqueItem <byte>(wallsVertical, current3.get_Key());
                         }
                     }
                 }
                 this.RaycastCheck <TSetCellVisible>(pFowMgr, cRaycastQuadrant, newSurfPos, unitLoc, sightSqr, camp, bDrawDebugLines, viewBlockId, ref setCellVisible);
             }
             cRaycastQuadrant.Clear();
         }
     }
 }
Exemplo n.º 18
0
 public Harmony(BaseAlgorithm myContainer) : base(myContainer)
 {
 }
        private void TriggerAction(Action _action, ref PoolObjHandle <ActorRoot> target)
        {
            if (!this.attackActor)
            {
                return;
            }
            uint objID = target.get_handle().ObjID;
            int  num;

            if (this.collideCountMap.TryGetValue(objID, ref num))
            {
                num++;
                this.collideCountMap.set_Item(objID, num);
            }
            else
            {
                this.collideCountMap.Add(objID, 1);
            }
            int num2 = 0;

            if (this.collideTimeMap.TryGetValue(objID, ref num2))
            {
                this.collideTimeMap.set_Item(objID, this.localTime);
            }
            else
            {
                this.collideTimeMap.Add(objID, this.localTime);
            }
            if (this.skillContext == null)
            {
                return;
            }
            this.skillContext.EffectCount++;
            this.skillContext.EffectCountInSingleTrigger++;
            if (!this.bTriggerMode)
            {
                this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_1, false);
                this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_2, false);
                this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_3, false);
            }
            else
            {
                if (this.skillContext.Originator && this.SelfSkillCombineID_1 > 0)
                {
                    HitTriggerDurationContext.STriggeredBuffContext inPoint = default(HitTriggerDurationContext.STriggeredBuffContext);
                    inPoint.actor  = this.skillContext.Originator;
                    inPoint.buffId = this.SelfSkillCombineID_1;
                    if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint))
                    {
                        this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_1, false);
                    }
                }
                if (this.skillContext.Originator && this.SelfSkillCombineID_2 > 0)
                {
                    HitTriggerDurationContext.STriggeredBuffContext inPoint2 = default(HitTriggerDurationContext.STriggeredBuffContext);
                    inPoint2.actor  = this.skillContext.Originator;
                    inPoint2.buffId = this.SelfSkillCombineID_2;
                    if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint2))
                    {
                        this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_2, false);
                    }
                }
                if (this.skillContext.Originator && this.SelfSkillCombineID_3 > 0)
                {
                    HitTriggerDurationContext.STriggeredBuffContext inPoint3 = default(HitTriggerDurationContext.STriggeredBuffContext);
                    inPoint3.actor  = this.skillContext.Originator;
                    inPoint3.buffId = this.SelfSkillCombineID_3;
                    if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint3))
                    {
                        this.attackActor.get_handle().SkillControl.SpawnBuff(this.skillContext.Originator, this.skillContext, this.SelfSkillCombineID_3, false);
                    }
                }
            }
            if (target)
            {
                this.hit = true;
                if (target.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && !this.bHitTargetHero)
                {
                    this.bHitTargetHero   = true;
                    this.HitTargetHeroPos = target.get_handle().location;
                }
                this.skillContext.EffectDir = this.attackActor.get_handle().forward;
                bool      flag       = false;
                BuffSkill buffSkill  = null;
                BuffSkill buffSkill2 = null;
                BuffSkill buffSkill3 = null;
                if (!this.bTriggerMode)
                {
                    this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_1, ref buffSkill, this.bExtraBuff);
                    this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_2, ref buffSkill2, this.bExtraBuff);
                    this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_3, ref buffSkill3, this.bExtraBuff);
                    if ((buffSkill != null && buffSkill.cfgData.bNotGetHate == 0) || (buffSkill2 != null && buffSkill2.cfgData.bNotGetHate == 0) || (buffSkill3 != null && buffSkill3.cfgData.bNotGetHate == 0))
                    {
                        flag = true;
                    }
                }
                else
                {
                    if (this.TargetSkillCombine_1 > 0)
                    {
                        HitTriggerDurationContext.STriggeredBuffContext inPoint4 = default(HitTriggerDurationContext.STriggeredBuffContext);
                        inPoint4.actor  = target;
                        inPoint4.buffId = this.TargetSkillCombine_1;
                        if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint4))
                        {
                            this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_1, ref buffSkill, false);
                        }
                        if (buffSkill != null && buffSkill.cfgData.bNotGetHate == 0)
                        {
                            flag = true;
                        }
                    }
                    if (this.TargetSkillCombine_2 > 0)
                    {
                        HitTriggerDurationContext.STriggeredBuffContext inPoint5 = default(HitTriggerDurationContext.STriggeredBuffContext);
                        inPoint5.actor  = target;
                        inPoint5.buffId = this.TargetSkillCombine_2;
                        if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint5))
                        {
                            this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_2, ref buffSkill2, false);
                        }
                        if (buffSkill2 != null && buffSkill2.cfgData.bNotGetHate == 0)
                        {
                            flag = true;
                        }
                    }
                    if (this.TargetSkillCombine_3 > 0)
                    {
                        HitTriggerDurationContext.STriggeredBuffContext inPoint6 = default(HitTriggerDurationContext.STriggeredBuffContext);
                        inPoint6.actor  = target;
                        inPoint6.buffId = this.TargetSkillCombine_3;
                        if (BaseAlgorithm.AddUniqueItem <HitTriggerDurationContext.STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint6))
                        {
                            this.attackActor.get_handle().SkillControl.SpawnBuff(target, this.skillContext, this.TargetSkillCombine_3, ref buffSkill3, false);
                        }
                        if (buffSkill3 != null && buffSkill3.cfgData.bNotGetHate == 0)
                        {
                            flag = true;
                        }
                    }
                }
                if (this.TargetSkillLeaveRemove_1 && buffSkill != null)
                {
                    this.RemoveSkillList.Add(buffSkill);
                }
                if (this.TargetSkillLeaveRemove_2 && buffSkill2 != null)
                {
                    this.RemoveSkillList.Add(buffSkill2);
                }
                if (this.TargetSkillLeaveRemove_3 && buffSkill3 != null)
                {
                    this.RemoveSkillList.Add(buffSkill3);
                }
                if (flag)
                {
                    target.get_handle().ActorControl.BeAttackHit(this.attackActor, this.skillContext.bExposing);
                }
            }
            if (this.bTriggerBullet && this.BulletActionName != null && this.BulletActionName.get_Length() > 0)
            {
                this.skillContext.AppointType = 1;
                this.skillContext.TargetActor = target;
                this.attackActor.get_handle().SkillControl.SpawnBullet(this.skillContext, this.BulletActionName, false, this.bAgeImmeExcute, 0, 0);
            }
        }
Exemplo n.º 20
0
 public FSPSolution(BaseAlgorithm myContainer) : base(myContainer)
 {
 }
Exemplo n.º 21
0
 public static float FInterpEaseOut(float A, float B, float Alpha, float Exp)
 {
     return(BaseAlgorithm.Lerp(A, B, Mathf.Pow(Alpha, 1f / Exp)));
 }
 protected ProbabilityCalculatingAlgorithm(BaseAlgorithm <TObservation, TState> baseAlgorithm)
     : base(baseAlgorithm)
 {
 }
 public ViterbiAlgorithm(BaseAlgorithm <TObservation, TState> baseAlgorithm) : base(baseAlgorithm)
 {
 }
Exemplo n.º 24
0
 public PrefixAlgorithm(BaseAlgorithm <TObservation, TState> baseAlgorithm) : base(baseAlgorithm)
 {
 }
Exemplo n.º 25
0
 public Frog(BaseAlgorithm myContainer) : base(myContainer)
 {
 }