/// <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; } }
public ScriptBufferEvent(ScriptBufferEventType type, int resourceNumber, byte[] data) { this.type = type; this.resourceNumber = resourceNumber; this.data = data; }