void MovingToPosition_Enter()
 {
     if (_currentBotWanderComponent.MovementTimeout > 0)
     {
         _movingToPosition_TimeOut = MovingToPosition_TimeOut();
         if (!BotLocomotiveComponent.MoveToPosition(_currentBotWanderComponent.StopMovementCondition, false))
         {
             FSM.ChangeState(FStatesWander.CannotWander);
             return;
         }
         DebugHelpers.LogInDebugMode(DebugMode, DEBUG_TAG, $"{transform.name} Wandering to {BotLocomotiveComponent.FocusedOnPosition.ToString()}");
         StartCoroutine(_movingToPosition_TimeOut);
     }
 }
Esempio n. 2
0
        public void ExecuteCommands_Insert(List <SqliteCommand> lstInsertCommands)
        {
            var query_log = string.Empty;

            using (var dbConnection = new SqliteConnection(Connection))
            {
                dbConnection.Open();
                using (var transaction = dbConnection.BeginTransaction())
                {
                    try
                    {
                        for (int i = 0; i < lstInsertCommands.Count; i++)
                        {
                            using (lstInsertCommands[i])
                            {
                                if (i == 0)
                                {
                                    query_log = string.Format("[{0} x Rows] {1}", lstInsertCommands.Count, lstInsertCommands[i].CommandText);
                                    DebugHelpers.LogInDebugMode(DebugMode, DEBUG_TAG, query_log);
                                }
                                lstInsertCommands[i].Connection = dbConnection;
                                lstInsertCommands[i].ExecuteNonQuery();
                            }
                        }
                        transaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        transaction.Rollback();
                        LogSQLQueryErrorInDebugMode(query_log, ex);
                    }
                }

                dbConnection.Close();
            }
        }
Esempio n. 3
0
        public void ExecuteCommand_Delete(SqliteCommand deleteCommand)
        {
            var query = string.Empty;

            try
            {
                using (var dbConnection = new SqliteConnection(Connection))
                {
                    dbConnection.Open();
                    using (deleteCommand)
                    {
                        query = deleteCommand.CommandText;
                        DebugHelpers.LogInDebugMode(DebugMode, DEBUG_TAG, query);
                        deleteCommand.Connection = dbConnection;
                        deleteCommand.ExecuteNonQuery();//ExecuteScalar();
                    }
                    dbConnection.Close();
                }
            }
            catch (Exception ex)
            {
                LogSQLQueryErrorInDebugMode(query, ex);
            }
        }
 protected void LogInDebugMode(string message, bool includeTimestamp = false)
 {
     DebugHelpers.LogInDebugMode(DebugMode, GetDebugTag(), message, includeTimestamp);
 }