private void OnChainIncrement(int aChainLength, HashSet <AbstractBlock> aMatchedBlocks)
        {
            Console.WriteLine($"Chain {aChainLength}!");
            myChainTimer = Math.Max(1.0f, myChainTimer + 1.0f);

            AbstractBlock rightMostTopMostBlock = aMatchedBlocks.First();

            foreach (AbstractBlock block in aMatchedBlocks)
            {
                if (block.GetPosition().X > rightMostTopMostBlock.GetPosition().X)
                {
                    rightMostTopMostBlock = block;
                }
                else if (block.GetPosition().X == rightMostTopMostBlock.GetPosition().X)
                {
                    if (block.GetPosition().Y > rightMostTopMostBlock.GetPosition().Y)
                    {
                        rightMostTopMostBlock = block;
                    }
                }
            }

            Vector2 blockScreenPosition = rightMostTopMostBlock.GetScreenPosition(myOffset, myGridContainer.GetInitialHeight() - 1, myRaisingOffset);
            Vector2 feedbackOffset      = new Vector2(AbstractBlock.GetTileSize(), AbstractBlock.GetTileSize()) / 2f;
            Vector2 feedbackPosition    = blockScreenPosition + feedbackOffset;

            FeedbackManager.AddFeedback(new ChainComboFeedback("x", aChainLength, feedbackPosition));
        }
        private void OnCombo(HashSet <AbstractBlock> aMatchedBlocks)
        {
            Console.WriteLine($"Combo! {aMatchedBlocks.Count}");
            const float MagicNumber = 0.3f;

            if (myChainTimer < 0.0f)
            {
                myChainTimer = 0.0f;
            }
            myChainTimer += (aMatchedBlocks.Count * MagicNumber) / myModifiedGameSpeed;
            CreateAngryComboBlock(aMatchedBlocks.Count - 1);

            AbstractBlock rightMostTopMostBlock = aMatchedBlocks.First();

            foreach (AbstractBlock block in aMatchedBlocks)
            {
                if (block.GetPosition().X > rightMostTopMostBlock.GetPosition().X)
                {
                    rightMostTopMostBlock = block;
                }
                else if (block.GetPosition().X == rightMostTopMostBlock.GetPosition().X)
                {
                    if (block.GetPosition().Y > rightMostTopMostBlock.GetPosition().Y)
                    {
                        rightMostTopMostBlock = block;
                    }
                }
            }

            Vector2 blockScreenPosition = rightMostTopMostBlock.GetScreenPosition(myOffset, myGridContainer.GetInitialHeight() - 1, myRaisingOffset);
            Vector2 feedbackOffset      = new Vector2(AbstractBlock.GetTileSize(), AbstractBlock.GetTileSize()) / 2f;
            Vector2 feedbackPosition    = blockScreenPosition + feedbackOffset;

            FeedbackManager.AddFeedback(new ChainComboFeedback("", aMatchedBlocks.Count, feedbackPosition));
        }
        private void DeadFeedback()
        {
            Vector2 middleOfGrid = new Vector2();

            middleOfGrid.X = myGridContainer.GetInitialWidth() / 2 * AbstractBlock.GetTileSize();
            middleOfGrid.Y = myGridContainer.GetInitialHeight() / 2 * AbstractBlock.GetTileSize();
            SpriteFeedback losar = new SpriteFeedback("losar", myOffset + middleOfGrid, () =>
            {
                return(myIsDead == false);
            });

            FeedbackManager.AddFeedback(losar);
        }
示例#4
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["UID"] == null || res["Content"] == null ||
                res["UID"].ToString().Trim().Length <= 0 || res["Content"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                try
                {
                    uid     = res["UID"].ToString().Trim();
                    content = res["Content"].ToString().Trim();
                }
                catch
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "数据格式不正确"));
                }

                string        userName = "";
                OPUserManager hum      = new OPUserManager();
                Hashtable     user_ht  = hum.GetUserInfoByUserID(uid);
                if (user_ht != null && user_ht.Count > 0)
                {
                    userName = user_ht["USERNAME"].ToString();
                }

                Hashtable ht = new Hashtable();
                ht["ID"]       = CommonHelper.GetGuid;
                ht["Content"]  = content;
                ht["UserID"]   = uid;
                ht["UserName"] = userName;
                ht["AppID"]    = "002";
                ht["AppName"]  = "运维app";
                ht["ReadFlag"] = 0;
                FeedbackManager fm        = new FeedbackManager();
                bool            isSuccess = fm.AddFeedback(ht);
                if (isSuccess)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "success", "意见反馈成功"));
                }
                else
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "意见反馈失败"));
                }
            }
        }
示例#5
0
        public virtual void DebugDied(int aPlayerIndex)
        {
            if (aPlayerIndex != myPlayerInfo.myPlayerIndex)
            {
                return;
            }
            Vector2 smallOffset = new Vector2();

            smallOffset.X = myGridBundle.Container.GetInitialWidth() / 3 * AbstractBlock.GetTileSize();
            smallOffset.Y = myGridBundle.Container.GetInitialHeight() / 3 * AbstractBlock.GetTileSize();
            SpriteFeedback losar = new SpriteFeedback("fantastiskt", myGridBundle.Behavior.GetOffset() + smallOffset, () =>
            {
                return(myGridBundle.Behavior.myIsDead == false);
            });

            FeedbackManager.AddFeedback(losar);
        }
示例#6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmFeedback frm = new frmFeedback(feedbackManager);

            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                Feedback feedback = frm.GetEnteredFeedback();
                try
                {
                    feedbackManager.AddFeedback(feedback);
                }
                catch (Exception ex)
                {
                    HandleCriticalException(ex);
                    return;
                }

                ShowLastFeedback();
                ToggleControls(true);
            }
        }
示例#7
0
        public void AddReview([FromBody] FeedBack feedBack)
        {
            FeedbackManager feedbackManager = new FeedbackManager();

            feedbackManager.AddFeedback(feedBack);
        }