public class SeaPiratesState extends Object
| Modifier and Type | Field and Description |
|---|---|
private static RandomNameLoader |
firstNameLoader |
private Set<ISeaPirate> |
freePirates
List of all free pirates
|
private static RandomNameLoader |
lastNameLoader |
private IMap |
map |
private com.google.common.collect.Multimap<IPlayer,ISeaPirate> |
nonFreePirates
List of the non free pirates
|
private Random |
rnd |
private ShipFactory |
shipFactory |
(package private) RandomNameLoader |
shipLoader |
| Constructor and Description |
|---|
SeaPiratesState() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ISeaPirate pirate,
com.google.common.base.Optional<IPlayer> player)
Add a pirate.
|
private IShip |
createInitialPiratesShip()
Create a ship for the pirate
|
ISeaPirate |
createNewPirate(String name,
IShip ship)
Create an new pirate anywhere on the sea
|
ISeaPirate |
createNewPirate(String name,
IShip ship,
javafx.geometry.Point2D near)
Create a pirate near a certain point
|
ISeaPirate |
findSuccessfulPirate()
Find a successful free pirate
|
void |
free(IPlayer player,
ISeaPirate pirate)
A non free pirate becomes free.
|
Set<ISeaPirate> |
getFreePirates()
Retrieve immutable list of free pirates.
|
List<ISeaPirate> |
getNonFreePirates(IPlayer player)
Retrieve immutable list of non free pirates for the player
|
void |
init() |
@Autowired private Random rnd
@Autowired private ShipFactory shipFactory
@Autowired private IMap map
private com.google.common.collect.Multimap<IPlayer,ISeaPirate> nonFreePirates
private Set<ISeaPirate> freePirates
private static RandomNameLoader firstNameLoader
private static RandomNameLoader lastNameLoader
RandomNameLoader shipLoader
@PostConstruct public void init()
private IShip createInitialPiratesShip()
public void add(ISeaPirate pirate, com.google.common.base.Optional<IPlayer> player)
pirate - player - public void free(IPlayer player, ISeaPirate pirate)
pirate - public List<ISeaPirate> getNonFreePirates(IPlayer player)
player - public Set<ISeaPirate> getFreePirates()
public ISeaPirate createNewPirate(String name, IShip ship)
name - ship - public ISeaPirate createNewPirate(String name, IShip ship, javafx.geometry.Point2D near)
name - ship - near - public ISeaPirate findSuccessfulPirate()
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.