Package net.sf.colossus.server
Class CustomRecruitBase
- java.lang.Object
-
- net.sf.colossus.server.CustomRecruitBase
-
- All Implemented Interfaces:
ICustomRecruitBase
public abstract class CustomRecruitBase extends java.lang.Object implements ICustomRecruitBase
Base class to implement custom recruiting functions (i.e. anything that is not a-number-of-creature to another creature)- Author:
- Romain Dolbeau
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<Caretaker>allCaretakerInfoprivate static java.util.List<CustomRecruitBase>allCustomRecruitBaseprotected static java.util.List<Player>allPlayersprivate static java.util.logging.LoggerLOGGERprivate static GameServerSideserverGame
-
Constructor Summary
Constructors Constructor Description CustomRecruitBase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static voidaddCaretakerClientSide(Caretaker ci)static voidaddPlayerClientSide(Player pi)protected voidadjustAvailableCount(CreatureType type)protected abstract voidchangeOfTurn(int newActivePlayer)Bookkeeping function, called once after every player turn.static voideveryoneAdvanceTurn(int newActivePlayer)abstract java.util.List<CreatureType>getAllPossibleSpecialRecruiters(MasterBoardTerrain terrain)List all creatures that can recruit in this terrain in a special way.abstract java.util.List<CreatureType>getAllPossibleSpecialRecruits(MasterBoardTerrain terrain)List all creatures that can be recruited in this terrain in a special way.protected intgetCount(CreatureType type)protected intgetDeadCount(CreatureType type)abstract java.util.List<CreatureType>getPossibleSpecialRecruiters(MasterHex hex)List creatures that can recruit in this terrain in a special way now.abstract java.util.List<CreatureType>getPossibleSpecialRecruits(MasterHex hex)List creatures that can be recruited in this terrain in a special way now.protected voidinitCustomVariant()static voidinitCustomVariantForAllCRBs()abstract intnumberOfRecruiterNeeded(CreatureType recruiter, CreatureType recruit, MasterHex hex)Number of recruiters needed to get a recruit in a special way in this terrain now.static voidreset()static voidresetAllInstances()protected abstract voidresetInstance()Reset, called at the beginning of a game.protected voidsetCount(CreatureType type, int newCount, boolean reset)static voidsetGame(GameServerSide g)
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
allPlayers
protected static final java.util.List<Player> allPlayers
-
allCaretakerInfo
private static final java.util.List<Caretaker> allCaretakerInfo
-
serverGame
private static GameServerSide serverGame
-
allCustomRecruitBase
private static final java.util.List<CustomRecruitBase> allCustomRecruitBase
-
-
Method Detail
-
reset
public static final void reset()
-
resetAllInstances
public static final void resetAllInstances()
-
initCustomVariant
protected void initCustomVariant()
-
initCustomVariantForAllCRBs
public static final void initCustomVariantForAllCRBs()
-
everyoneAdvanceTurn
public static final void everyoneAdvanceTurn(int newActivePlayer)
-
addPlayerClientSide
public static final void addPlayerClientSide(Player pi)
-
addCaretakerClientSide
public static final void addCaretakerClientSide(Caretaker ci)
-
setGame
public static final void setGame(GameServerSide g)
-
setCount
protected final void setCount(CreatureType type, int newCount, boolean reset)
-
adjustAvailableCount
protected final void adjustAvailableCount(CreatureType type)
-
getCount
protected final int getCount(CreatureType type)
-
getDeadCount
protected final int getDeadCount(CreatureType type)
-
getAllPossibleSpecialRecruiters
public abstract java.util.List<CreatureType> getAllPossibleSpecialRecruiters(MasterBoardTerrain terrain)
List all creatures that can recruit in this terrain in a special way.- Specified by:
getAllPossibleSpecialRecruitersin interfaceICustomRecruitBase
-
getAllPossibleSpecialRecruits
public abstract java.util.List<CreatureType> getAllPossibleSpecialRecruits(MasterBoardTerrain terrain)
List all creatures that can be recruited in this terrain in a special way.- Specified by:
getAllPossibleSpecialRecruitsin interfaceICustomRecruitBase
-
getPossibleSpecialRecruiters
public abstract java.util.List<CreatureType> getPossibleSpecialRecruiters(MasterHex hex)
List creatures that can recruit in this terrain in a special way now.- Specified by:
getPossibleSpecialRecruitersin interfaceICustomRecruitBase- Parameters:
hex- The specific MasterHex considered for recruiting.- Returns:
- A List of possible special Recruiters in this hex.
-
getPossibleSpecialRecruits
public abstract java.util.List<CreatureType> getPossibleSpecialRecruits(MasterHex hex)
List creatures that can be recruited in this terrain in a special way now.- Specified by:
getPossibleSpecialRecruitsin interfaceICustomRecruitBase- Parameters:
hex- The specific MasterHex considered for recruiting (for an example, see getPossibleSpecialRecruits() in BalrogRecruitment.java in Balrog variant directory)- Returns:
- A List of possible special Recruits in this hex.
-
numberOfRecruiterNeeded
public abstract int numberOfRecruiterNeeded(CreatureType recruiter, CreatureType recruit, MasterHex hex)
Number of recruiters needed to get a recruit in a special way in this terrain now.- Specified by:
numberOfRecruiterNeededin interfaceICustomRecruitBase
-
changeOfTurn
protected abstract void changeOfTurn(int newActivePlayer)
Bookkeeping function, called once after every player turn. Protected as it should only be called from everyoneAdvanceTurn().
-
resetInstance
protected abstract void resetInstance()
Reset, called at the beginning of a game.
-
-