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); }
//------------------------------------ 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"); } }
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; } }
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)); } }