Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/pepperview/romzinger/GameSetCollection.java


1   /*
2    * GameSetCollection.java -
3    * Copyright (C) 2000 Fabrice Armisen
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18   */
19  
20  package com.pepperview.romzinger;
21  
22  
23  import java.util.Vector;
24  import java.util.Enumeration;
25  
26  public class GameSetCollection
27  {
28    private Vector gameSetList = null;
29  
30    public GameSetCollection()
31    {
32      gameSetList = new Vector();
33    }
34  
35    public Enumeration getGameSets()
36    {
37      return gameSetList.elements();
38    }
39  
40  
41    public void addGameSet( GameSet set )
42    {
43      gameSetList.add( set );
44    }
45  
46    public GameDesc matchGame( Game game )
47    {
48      for ( int i = 0; i<gameSetList.size(); i++)
49      {
50        GameDesc desc =  ((GameSet) gameSetList.elementAt( i ) ).matchGame( game );
51        if ( null != desc )
52        {
53          return desc;
54        }
55      }
56      return null;
57    }
58  }