Gridarta Editor
MapManager.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (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 along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.model.mapmanager;
21 
22 import java.io.File;
23 import java.io.IOException;
24 import java.util.List;
30 import org.jetbrains.annotations.NotNull;
31 import org.jetbrains.annotations.Nullable;
32 
37 public interface MapManager<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> {
38 
48  @NotNull
49  MapControl<G, A, R> openMapFile(@NotNull MapFile mapFile, boolean interactive) throws IOException;
50 
60  @NotNull
61  MapControl<G, A, R> openMapFile(@NotNull File file, boolean interactive) throws IOException;
62 
67  void closeMap(@NotNull MapControl<G, A, R> mapControl);
68 
79  @NotNull
80  MapControl<G, A, R> newMap(@Nullable List<G> objects, @NotNull A mapArchObject, @Nullable MapFile mapFile, boolean interactive);
81 
86  void setCurrentMap(@Nullable MapControl<G, A, R> mapControl);
87 
92  @NotNull
93  List<MapControl<G, A, R>> getOpenedMaps();
94 
99  @Nullable
101 
106  @Nullable
108 
113  void addMapManagerListener(@NotNull MapManagerListener<G, A, R> listener);
114 
120 
126  void revert(@NotNull MapControl<G, A, R> mapControl) throws IOException;
127 
132  File getLocalMapDir();
133 
138  void release(@NotNull MapControl<G, A, R> mapControl);
139 
140 }
void removeMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Removes a MapManagerListener to be notified.
A MapManager manages all opened maps.
Definition: MapManager.java:37
void release(@NotNull MapControl< G, A, R > mapControl)
Releases a MapControl instance.
MapControl< G, A, R > newMap(@Nullable List< G > objects, @NotNull A mapArchObject, @Nullable MapFile mapFile, boolean interactive)
Creates a new map control without view.
File getLocalMapDir()
Returns a guess for a script directory to use.
void revert(@NotNull MapControl< G, A, R > mapControl)
Reverts one map.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
Definition: GameObject.java:36
GameObjects are the objects based on Archetypes found on maps.
MapControl< G, A, R > getCurrentMap()
Returns the current map.
void setCurrentMap(@Nullable MapControl< G, A, R > mapControl)
Sets the given map as the current one.
void addMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Adds a MapManagerListener to be notified.
Currently nothing more than a marker interface for unification.
Definition: MapControl.java:35
void closeMap(@NotNull MapControl< G, A, R > mapControl)
Closes the given map, ignoring modified status.
MapControl< G, A, R > getOpenMap()
Returns one open map.
MapControl< G, A, R > openMapFile(@NotNull MapFile mapFile, boolean interactive)
Loads a map file.
List< MapControl< G, A, R > > getOpenedMaps()
Returns all opened maps.
The location of a map file with a map directory.
Definition: MapFile.java:31