![]() |
Gridarta Editor
|
Checks that a game object does not set a custom type. More...
Public Member Functions | |
void | addIgnore (final int fromType, final int toType) |
Adds an allowed type change. More... | |
void | addIgnore (final int fromType, final int toType, final int envType) |
Adds an allowed type change. More... | |
CustomTypeChecker (@NotNull final ValidatorPreferences validatorPreferences) | |
Creates a new instance. More... | |
void | validateGameObject (@NotNull final G gameObject, @NotNull final ErrorCollector< G, A, R > errorCollector) |
Validates a game object. More... | |
![]() | |
String | getKey () |
boolean | isDefaultEnabled () |
boolean | isEnabled () |
void | setEnabled (final boolean enabled) |
![]() | |
String | getKey () |
Get a Key that uniquely identifies this Validator. More... | |
boolean | isDefaultEnabled () |
Get whether this Validator should be enabled per default. More... | |
boolean | isEnabled () |
Get whether this Validator is enabled. More... | |
void | setEnabled (boolean enabled) |
Set whether this Validator should be enabled. More... | |
Private Member Functions | |
Map< Integer, Integer > | getIgnoreSet (final int type) |
Returns the allowed type changes for a given source type. More... | |
boolean | isAllowedTypeChange (@NotNull final GameObject< G, A, R > gameObject, final int archetypeTypeNo, final int gameObjectTypeNo) |
Returns whether the given game's changed type is allowed. More... | |
Private Attributes | |
final Map< Integer, Map< Integer, Integer > > | ignoreEntries = new HashMap<>() |
The allowed type changes. More... | |
Additional Inherited Members | |
![]() | |
AbstractValidator (@NotNull final ValidatorPreferences validatorPreferences) throws IllegalArgumentException | |
Creates a new instance. More... | |
AbstractValidator (@NotNull final ValidatorPreferences validatorPreferences, @NotNull final String key) | |
Creates a new instance. More... | |
Checks that a game object does not set a custom type.
Definition at line 39 of file CustomTypeChecker.java.
net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.CustomTypeChecker | ( | @NotNull final ValidatorPreferences | validatorPreferences | ) |
Creates a new instance.
validatorPreferences | the validator preferences to use |
Definition at line 53 of file CustomTypeChecker.java.
void net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addIgnore | ( | final int | fromType, |
final int | toType | ||
) |
Adds an allowed type change.
fromType | the allowed source type |
toType | the allowed destination type |
Definition at line 98 of file CustomTypeChecker.java.
void net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addIgnore | ( | final int | fromType, |
final int | toType, | ||
final int | envType | ||
) |
Adds an allowed type change.
fromType | the allowed source type |
toType | the allowed destination type |
envType | the type of the parent object |
Definition at line 108 of file CustomTypeChecker.java.
|
private |
Returns the allowed type changes for a given source type.
type | the source type |
Definition at line 118 of file CustomTypeChecker.java.
|
private |
Returns whether the given game's changed type is allowed.
gameObject | the game object to check |
archetypeTypeNo | the old type |
gameObjectTypeNo | the new type |
Definition at line 73 of file CustomTypeChecker.java.
References net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.getTypeNo(), and net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ignoreEntries.
void net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.validateGameObject | ( | @NotNull final G | gameObject, |
@NotNull final ErrorCollector< G, A, R > | errorCollector | ||
) |
Validates a game object.
gameObject | the game object to validate |
errorCollector | the error collector to report errors to |
Definition at line 58 of file CustomTypeChecker.java.
|
private |
The allowed type changes.
Maps source type to destination type to environment type. The environment type may be
to denote "any environment".
Definition at line 47 of file CustomTypeChecker.java.
Referenced by net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getIgnoreSet(), and net.sf.gridarta.model.validation.checks.CustomTypeChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isAllowedTypeChange().