Gridarta Editor
TestFileControl.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;
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
29 
34 public class TestFileControl implements FileControl<TestGameObject, TestMapArchObject, TestArchetype> {
35 
39  @NotNull
40  private final StringBuilder sb = new StringBuilder();
41 
42  @Override
43  public void openFile(final boolean mapFile) {
44  throw new AssertionError();
45  }
46 
47  @Override
48  public boolean save(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) {
49  throw new AssertionError();
50  }
51 
52  @Override
53  public void saveAllMaps() {
54  throw new AssertionError();
55  }
56 
57  @Override
58  public boolean closeAllMaps() {
59  throw new AssertionError();
60  }
61 
62  @Override
63  public boolean saveAs(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) {
64  throw new AssertionError();
65  }
66 
67  @Override
69  throw new AssertionError();
70  }
71 
72  @Override
73  public void reportSaveError(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @NotNull final String message) {
74  throw new AssertionError();
75  }
76 
77  @Override
78  public void reportSaveError(@NotNull final File mapFile, @NotNull final String message) {
79  sb.append("reportSaveError: ");
80  sb.append(mapFile);
81  sb.append(" ");
82  sb.append(message);
83  sb.append("\n");
84  }
85 
86  @Override
87  public void reportLoadError(@Nullable final File file, @NotNull final String message) {
88  throw new AssertionError();
89  }
90 
91  @Override
92  public void reportOutOfMapBoundsDeleted(@NotNull final File file, final int outOfMapBoundsDeleted, @NotNull final StringBuilder outOfMapBoundsObjects) {
93  throw new AssertionError();
94  }
95 
96  @Override
97  public void reportOutOfMemory(@NotNull final File file) {
98  throw new AssertionError();
99  }
100 
101  @Override
102  public void reportTeleportCharacterError(@NotNull final String mapPath, @NotNull final String message) {
103  throw new AssertionError();
104  }
105 
106  @Override
107  public String toString() {
108  return sb.toString();
109  }
110 
111 }
boolean save(@NotNull final MapControl< TestGameObject, TestMapArchObject, TestArchetype > mapControl)
void reportOutOfMemory(@NotNull final File file)
void reportLoadError(@Nullable final File file, @NotNull final String message)
A MapArchObject implementation for testing purposes.
boolean confirmSaveChanges(@NotNull final MapControl< TestGameObject, TestMapArchObject, TestArchetype > mapControl)
Base package of all Gridarta classes.
void reportSaveError(@NotNull final File mapFile, @NotNull final String message)
A FileControl implementation for testing purposes.
GameObjects are the objects based on Archetypes found on maps.
boolean saveAs(@NotNull final MapControl< TestGameObject, TestMapArchObject, TestArchetype > mapControl)
final StringBuilder sb
Collects the performed actions.
Currently nothing more than a marker interface for unification.
Definition: MapControl.java:35
An Archetype implementation for testing purposes.
A GameObject implementation for testing purposes.
void reportTeleportCharacterError(@NotNull final String mapPath, @NotNull final String message)
void reportOutOfMapBoundsDeleted(@NotNull final File file, final int outOfMapBoundsDeleted, @NotNull final StringBuilder outOfMapBoundsObjects)
void reportSaveError(@NotNull final MapControl< TestGameObject, TestMapArchObject, TestArchetype > mapControl, @NotNull final String message)