예제 #1
0
        // =====
        #region Methods

        // Destroy this trigger
        public void Destroy()
        {
            // Entry logging
      #if IS_LOGGING_METHODS
            Log.Write(String.Format("Entering method for {0}", this.Name));
      #endif

            // Nullify instance variables
            this.name      = null;
            this.condition = null;
            this.actions   = null;
            // this.actionIndex = null;
            this.parallelActions    = null;
            this.parallelIndeces    = null;
            this.conditionArguments = null;
            this.actionArguments    = null;

            // Add to list of dying triggers
            Globals.TriggerManager.DyingTriggers.Add(this);

            // Exit logging
      #if IS_LOGGING_METHODS
            Log.Write(String.Format("Exiting method for {0}", this.Name));
      #endif
        }
예제 #2
0
        // =====
        #region Constructors

        // Default constructor
        public Trigger()
        {
            // Entry logging
      #if IS_LOGGING_METHODS
            Log.Write("Entering method");
      #endif

            // Set instance variables
            // this.name = Globals.NameHelper.GetName("Trig");
            this.condition          = null;
            this.actions            = new List <Action.Method>();
            this.parallelActions    = new List <Action.Method>();
            this.parallelIndeces    = new List <int>();
            this.conditionArguments = new List <Object>();
            this.actionArguments    = new List <List <Object> >();

            this.isSleeping         = false;
            this.isRunning          = false;
            this.isPreserved        = false;
            this.inspectionPeriod   = 0.0f;
            this.inspectionPosition = this.inspectionPeriod;

            // Add to manager
            Globals.TriggerManager.Triggers.Add(this);
            if (!this.IsSleeping)
            {
                Globals.TriggerManager.AwakeTriggers.Add(this);
            }

            // Exit logging
      #if IS_LOGGING_METHODS
            Log.Write("Exiting method");
      #endif
        }