Class ServerBuilding

    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
    • Constructor Detail

      • ServerBuilding

        public ServerBuilding​(Game game,
                              java.lang.String id)
        Trivial constructor for Game.newInstance.
        Parameters:
        game - The Game this object belongs to.
        id - The object identifier.
      • ServerBuilding

        public ServerBuilding​(Game game,
                              Colony colony,
                              BuildingType type)
        Creates a new ServerBuilding.
        Parameters:
        game - The Game this object belongs to.
        colony - The Colony in which this building is located.
        type - The BuildingType of building.
    • Method Detail

      • csTeach

        private void csTeach​(ChangeSet cs)
        Teach all the units in this school.
        Parameters:
        cs - A ChangeSet to update.
      • csCheckTeach

        public boolean csCheckTeach​(Unit teacher,
                                    ChangeSet cs)
        Check and complete teaching if possible. This needs to be separate and public because of the recheck of teaching required if the colony production bonus rises at end of new turn calculations.
        Parameters:
        teacher - The teaching Unit.
        cs - A ChangeSet to update.
        Returns:
        True if teaching occurred.
      • csTrainStudent

        private boolean csTrainStudent​(Unit teacher,
                                       Unit student,
                                       ChangeSet cs)
        Train a student.
        Parameters:
        teacher - The teacher Unit.
        student - The student Unit to train.
        cs - A ChangeSet to update.
        Returns:
        True if teaching occurred.
      • csAssignStudent

        private boolean csAssignStudent​(Unit teacher,
                                        ChangeSet cs)
        Assigns a student to a teacher within a building.
        Parameters:
        teacher - The Unit that is teaching.
        cs - A ChangeSet to update.
        Returns:
        True if a student was assigned.
      • csRepairUnits

        private void csRepairUnits​(ChangeSet cs)
        Repair the units in this building.
        Parameters:
        cs - A ChangeSet to update.
      • csCheckMissingInput

        public void csCheckMissingInput​(ProductionInfo pi,
                                        ChangeSet cs)
        Check a building to see if it is missing input. The building must need input, have a person working there, and have no production occurring.
        Parameters:
        pi - The ProductionInfo for the building.
        cs - A ChangeSet to update.
      • csNewTurn

        public void csNewTurn​(java.util.Random random,
                              LogBuilder lb,
                              ChangeSet cs)
        New turn for this building.
        Specified by:
        csNewTurn in interface TurnTaker
        Parameters:
        random - A Random number source.
        lb - A LogBuilder to log to.
        cs - A ChangeSet to update.