2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
* You should have received a copy of the GNU General Public License
11
* along with this program; if not, write to the Free Software
12
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* Created on October 17, 2001, 9:21 PM
21
package games.strategy.engine.data;
23
import games.strategy.engine.delegate.*;
30
* @author Sean Bridges
34
public class DelegateList extends GameDataComponent implements Iterable<IDelegate>
36
private Map<String, IDelegate> m_delegates = new HashMap<String, IDelegate>();
38
public DelegateList(GameData data)
43
public void addDelegate(IDelegate del)
45
m_delegates.put(del.getName(), del);
50
return m_delegates.size();
53
public Iterator<IDelegate> iterator()
55
return m_delegates.values().iterator();
58
public IDelegate getDelegate(String name)
60
return m_delegates.get(name);
63
private void writeObject(ObjectOutputStream out)
65
//dont write since delegates should be handled seperatly.
68
private void readObject(ObjectInputStream in)
70
m_delegates = new HashMap<String, IDelegate>();