public class DefaultTeamManagerFactory extends Object implements TeamManagerFactory
The default implementation of the TeamManagerFactory
. Upon request,
the factory creates a TeamManager
behavior with a specified
TeamMatcher
and (optionally) a specified TeamDatabase
. If no
database is specified, a default implementation of the
MemoryTeamDatabase
is instantiated.
Note that each factory instance can create only one team manager instance. This is due to the fact that, otherwise, two team manager instances would use the same matcher and database. Cloning these dependencies, however, is impossible. Both interfaces might be implemented by the same class (e.g., in order to update the matcher reference based on the current database entries). If both dependencies were cloned, they would no longer be the same class.
TeamMatcher
,
TeamDatabase
Constructor and Description |
---|
DefaultTeamManagerFactory(TeamMatcher matcher)
Instantiates this factory with a specified matcher.
|
DefaultTeamManagerFactory(TeamMatcher matcher,
TeamDatabase database)
Instantiates this factory with a specified matcher and database.
|
Modifier and Type | Method and Description |
---|---|
TeamManager |
createTeamManager(BehaviorController controller)
Instantiates the team manager.
|
public DefaultTeamManagerFactory(TeamMatcher matcher)
matcher
- the team matcher for the team managerNullPointerException
- if the matcher is null
public DefaultTeamManagerFactory(TeamMatcher matcher, TeamDatabase database)
matcher
- the team matcher for the team managerdatabase
- the team database for the team managerNullPointerException
- if the matcher is null
NullPointerException
- if the database is null
public TeamManager createTeamManager(BehaviorController controller)
createTeamManager
in interface TeamManagerFactory
controller
- the controller for the behavior to be createdIllegalStateException
- if the team manager has been created alreadyNullPointerException
- if the controller is null
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.