#include "StdAfx.h" #include "T2OptionPlugin.h" #include "T2OptionPluginList.h" T2OptionPluginList::T2OptionPluginList() : LArray(sizeof(T2OptionPlugin *)) { } /*virtual*/ T2OptionPluginList::~T2OptionPluginList() { } void T2OptionPluginList::Add(T2OptionPlugin* plugin) { if (!plugin) return; InsertItemsAt(1, mItemCount + 1, &plugin); } void T2OptionPluginList::OnIdle(T2TowerDoc* towerDoc) { DispatchEvent(kIdleOptionEvent, towerDoc, NULL); } BOOL T2OptionPluginList::DispatchEvent(OPTIONEVENTTYPE eventType, T2TowerDoc* towerDoc, void* data) { LArrayIterator iterator(*this); BOOL result = true; T2OptionPlugin *thePlugin; while (iterator.Next(&thePlugin)) { result = result && thePlugin->OnEvent(eventType, towerDoc, data); } return result; }