Exemple #1
0
        public ActionInserterResponse Insert(string ownerId, string actionName, string actionPayload)
        {
            if (_cooldownRegistry.IsCooldownInEffect(ownerId))
            {
                _logger.Warn($"User with id '{ownerId}' tried inserting action '{actionName}' before cooldown was over");
                return(new ActionInserterResponse {
                    Success = false
                });
            }

            var action = _actionFactoryRegistry.Create(ownerId, actionName, actionPayload);

            return(AppendAction(action));
        }
Exemple #2
0
 private void ResolveActionsForAutonomousEntities()
 {
     foreach (var autonomous in _autonomousRegistry.GetAll().Where(i => !_cooldownRegistry.IsCooldownInEffect(i.Id)))
     {
         autonomous.Act();
     }
 }