Ejemplo n.º 1
0
        /// <summary>
        /// Add an event to the script buffer
        /// </summary>
        /// <param name="action"></param>
        /// <param name="who"></param>
        public void AddScript(ScriptBufferEventType action, int who, byte[] data = null)
        {
            if (state.Flags[Defines.NO_SCRIPT])
            {
                return;
            }

            if (doScript)
            {
                if (Events.Count >= this.ScriptSize)
                {
                    // TODO: Error. Error(11, maxScript);
                    return;
                }
                else
                {
                    Events.Add(new ScriptBufferEvent(action, who, data));
                }
            }

            if (Events.Count > MaxScript)
            {
                MaxScript = Events.Count;
            }
        }
Ejemplo n.º 2
0
 public ScriptBufferEvent(ScriptBufferEventType type, int resourceNumber, byte[] data)
 {
     this.type           = type;
     this.resourceNumber = resourceNumber;
     this.data           = data;
 }