View Javadoc

1   package erland.game.tileadventure;
2   /*
3    * Copyright (C) 2004 Erland Isaksson (erland_i@hotmail.com)
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 (at your option) 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  
21  import erland.game.GameEnvironmentInterface;
22  import erland.game.BlockContainerInterface;
23  
24  /***
25   * Defines all methods needed for a game model for the game
26   */
27  public interface TileAdventureModelInterface {
28      /*** Begin moving left */
29      void startMoveLeft();
30      /*** Begin moving right */
31      void startMoveRight();
32      /*** Begin moving up */
33      void startMoveUp();
34      /*** Begin moving down */
35      void startMoveDown();
36      /*** Stop moveing left */
37      void stopMoveLeft();
38      /*** Stop moving right */
39      void stopMoveRight();
40      /*** Stop moving up */
41      void stopMoveUp();
42      /*** Stop moving down */
43      void stopMoveDown();
44      /*** Jump */
45      void jump();
46      /***
47       * Initialize model
48       * @param environment Game environment object
49       * @param cont Block container for the game area
50       */
51      void init(GameEnvironmentInterface environment, IrregularBlockContainerInterface cont);
52  
53      /*** Start the game */
54      void start();
55  
56      /*** Update model */
57      void update();
58  
59      /***
60       * Get the active map
61       */
62      MapDrawInterface getMap();
63  
64      /***
65       * Get the player object
66       */
67      GameObject getPlayerObject();
68  
69      /***
70       * Get number of human controlled players
71       * @return Number of human contolled players
72       */
73      int getNoOfHumanPlayers();
74  
75      /***
76       * Check if game has ended
77       * @return true if game has ended
78       */
79      boolean isEnd();
80      /***
81       * Check if it is game over
82       * @return true if it is game over
83       */
84      boolean isGameOver();
85      /***
86       * Check if game has been completed
87       * @return true if game has been completed
88       */
89      boolean isCompleted();
90      /***
91       * Check if game has been started
92       * @return true if game has been started
93       */
94      boolean isStarted();
95      /***
96       * Check if game has been initialized
97       * @return true if game has been initialized
98       */
99      boolean isInitialized();
100     /***
101      * Check if this is a multi player game
102      * @return true if multi player
103      */
104     boolean isMultiplayer();
105 
106     /***
107      * Get an information string from the model
108      * @return The information string
109      */
110     String getInfoString();
111     /***
112      * Set a cheat parameter
113      * @param parameter Cheat parameter name
114      * @param value Cheat parameter value
115      */
116     void setCheatModeParameter(String parameter, String value);
117 }