Class ExitMatcher<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.exitconnector.ExitMatcher<G,A,R>
-
- All Implemented Interfaces:
java.io.Serializable,GameObjectMatcher
public class ExitMatcher<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements GameObjectMatcher
Selects valid exit game objects from maps.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExitMatcher(@NotNull GameObjectMatcher exitMatcher)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GgetExit(@NotNull MapModel<G,A,R> mapModel, @Nullable java.awt.Point point)Returns an exit game object on a given map square.GgetExit(G exit)Returns whether the given game object is an exit game object.GgetValidExit(@NotNull MapModel<G,A,R> mapModel, @NotNull java.awt.Point point)Returns an exit game object on a given map square having exit information.@Nullable GameObject<G,A,R>getValidExit(G exit)Returns whether the given game object is an exit game object having exit information.booleanisMatching(@NotNull GameObject<?,?,?> gameObject)Matches aGameObject.
-
-
-
Constructor Detail
-
ExitMatcher
public ExitMatcher(@NotNull @NotNull GameObjectMatcher exitMatcher)Creates a new instance.- Parameters:
exitMatcher- the matcher for selecting exit objects
-
-
Method Detail
-
getValidExit
@Nullable public G getValidExit(@NotNull @NotNull MapModel<G,A,R> mapModel, @NotNull @NotNull java.awt.Point point)
Returns an exit game object on a given map square having exit information.- Parameters:
mapModel- the map model to checkpoint- the map square to check- Returns:
- the head of the exit game object
-
getValidExit
@Nullable public @Nullable GameObject<G,A,R> getValidExit(@Nullable G exit)
Returns whether the given game object is an exit game object having exit information.- Parameters:
exit- the game object to check- Returns:
- the game object's head if it is an exit game object or else
null
-
getExit
@Nullable public G getExit(@NotNull @NotNull MapModel<G,A,R> mapModel, @Nullable @Nullable java.awt.Point point)
Returns an exit game object on a given map square.- Parameters:
mapModel- the map model to checkpoint- the map square to check- Returns:
- the head of the exit game object or
nullif none was found
-
getExit
@Nullable public G getExit(@Nullable G exit)
Returns whether the given game object is an exit game object.- Parameters:
exit- the game object to check- Returns:
- the game object's head if it is an exit game object or else
null
-
isMatching
public boolean isMatching(@NotNull @NotNull GameObject<?,?,?> gameObject)Description copied from interface:GameObjectMatcherMatches aGameObject.- Specified by:
isMatchingin interfaceGameObjectMatcher- Parameters:
gameObject- theGameObjectto match- Returns:
trueif this matcher matches the given game object, otherwisefalse
-
-