コード例 #1
0
 public override void Update(PD_Game game, PD_AI_PathFinder pathFinder)
 {
     GameSettings.Update(game, pathFinder);
     GameCondition.Update(game, pathFinder);
     GameScores.Update(game, pathFinder);
     ActionStats.Update(game, pathFinder);
     GameStateEvaluationMetrics.Update(game, pathFinder);
     MapStats.Update(game, pathFinder);
 }
コード例 #2
0
ファイル: ActionControl.cs プロジェクト: kashin/CardGame
    //------------------------------------ MONOBEHAVIOR ------------------------------------------//
    void Start()
    {
        if (actionGameOnject != null)
        {
            actionStats = actionGameOnject.GetComponent<ActionStats>();
        }
        if (actionStats == null)
        {
            Debug.LogWarning("ActionControl: actionStats component is null!");
        }

        GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
        if (playerObj != null)
        {
            playerStats = playerObj.GetComponent<PlayerStats>();
        }
        else
        {
            Debug.LogWarning("ActionControl: Player object is not found");
        }

        GameObject enemyObj = GameObject.FindGameObjectWithTag("Enemy");
        if (enemyObj != null)
        {
            enemyStats = enemyObj.GetComponent<CharacterStats>();
        }
        else
        {
            Debug.LogWarning("ActionControl: Enemy object is not found");
        }
        if (actionStats == null)
        {
            actionStats = gameObject.GetComponent<ActionStats>();
        }

        GameObject statsPanelObj = GameObject.FindGameObjectWithTag("StatsPanel");
        if (statsPanelObj != null)
        {
            statsPanel = statsPanelObj.GetComponent<StatsPanel>();
            actionPressedEvent += statsPanel.onActionPresssed;
        }
        else
        {
            Debug.LogWarning("ActionControl: StatsPanel object is not found");
        }
    }
コード例 #3
0
        protected static void UpdateCounters(int ms, string action)
        {
            lock (CounterLockObject)
            {
                RequestsCount++;
                RequestsDuration += ms;

                ActionStats actionsStats;
                ActionsStats.TryGetValue(action, out actionsStats);
                if (actionsStats == null)
                {
                    actionsStats = new ActionStats()
                    {
                        Action = action
                    };
                    ActionsStats.Add(action, actionsStats);
                }

                actionsStats.Count++;
                actionsStats.Duration += ms;
            }
        }
コード例 #4
0
        public HttpResponseMessage Post([FromBody] APIModels.ActionStat actions)
        {
            try
            {
                using (ChangeCodeEntities db = new ChangeCodeEntities())
                {
                    actions.IDAction = db.Actions.Where(l => l.ActionURL.Contains(actions.IDStatus)).FirstOrDefault().ID;
                    ActionStats akcija = Mapper.Map <ActionStats>(actions);
                    akcija.ID   = Guid.NewGuid();
                    akcija.Date = DateTime.Now;

                    db.ActionStats.Add(akcija);
                    db.SaveChanges();
                }



                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                return(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
        }