org.mars_sim.msp.core.structure.building.function
Class Manufacture

java.lang.Object
  extended by org.mars_sim.msp.core.structure.building.function.Function
      extended by org.mars_sim.msp.core.structure.building.function.Manufacture
All Implemented Interfaces:
Serializable

public class Manufacture
extends Function
implements Serializable

A building function for manufacturing.

See Also:
Serialized Form

Field Summary
static String NAME
           
 
Constructor Summary
Manufacture(Building building)
          Constructor
 
Method Summary
 void addProcess(ManufactureProcess process)
          Adds a new manufacturing process to the building.
 void addSalvageProcess(SalvageProcess process)
          Adds a new salvage process to the building.
 void destroy()
          Prepare object for garbage collection.
 void endManufacturingProcess(ManufactureProcess process, boolean premature)
          Ends a manufacturing process.
 void endSalvageProcess(SalvageProcess process, boolean premature)
          Ends a salvage process.
 int getConcurrentProcesses()
          Gets the maximum concurrent manufacturing processes supported by the building.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
static double getFunctionValue(String buildingName, boolean newBuilding, Settlement settlement)
          Gets the value of the function for a named building.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 List<ManufactureProcess> getProcesses()
          Gets a list of the current manufacturing processes.
 List<SalvageProcess> getSalvageProcesses()
          Gets a list of the current salvage processes.
 int getTechLevel()
          Gets the manufacturing tech level of the building.
 int getTotalProcessNumber()
          Gets the total manufacturing and salvage processes currently in this building.
 boolean requiresManufacturingWork(int skill)
          Checks if manufacturing function currently requires manufacturing work.
 boolean requiresSalvagingWork(int skill)
          Checks if manufacturing function currently requires salvaging work.
 void timePassing(double time)
          Time passing for the building.
 
Methods inherited from class org.mars_sim.msp.core.structure.building.function.Function
getBuilding, getMalfunctionScopeStrings, getName, removeFromSettlement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

Manufacture

public Manufacture(Building building)
Constructor

Parameters:
building - the building the function is for.
Throws:
BuildingException - if error constructing function.
Method Detail

getFunctionValue

public static double getFunctionValue(String buildingName,
                                      boolean newBuilding,
                                      Settlement settlement)
Gets the value of the function for a named building.

Parameters:
buildingName - the building name.
newBuilding - true if adding a new building.
settlement - the settlement.
Returns:
value (VP) of building function.
Throws:
Exception - if error getting function value.

getTechLevel

public int getTechLevel()
Gets the manufacturing tech level of the building.

Returns:
tech level.

getConcurrentProcesses

public int getConcurrentProcesses()
Gets the maximum concurrent manufacturing processes supported by the building.

Returns:
maximum concurrent processes.

getTotalProcessNumber

public int getTotalProcessNumber()
Gets the total manufacturing and salvage processes currently in this building.

Returns:
total process number.

getProcesses

public List<ManufactureProcess> getProcesses()
Gets a list of the current manufacturing processes.

Returns:
unmodifiable list of processes.

addProcess

public void addProcess(ManufactureProcess process)
Adds a new manufacturing process to the building.

Parameters:
process - the new manufacturing process.
Throws:
BuildingException - if error adding process.

getSalvageProcesses

public List<SalvageProcess> getSalvageProcesses()
Gets a list of the current salvage processes.

Returns:
unmodifiable list of salvage processes.

addSalvageProcess

public void addSalvageProcess(SalvageProcess process)
Adds a new salvage process to the building.

Parameters:
process - the new salvage process.
Throws:
BuildingException - if error adding process.

getFullPowerRequired

public double getFullPowerRequired()
Description copied from class: Function
Gets the amount of power required when function is at full power.

Specified by:
getFullPowerRequired in class Function
Returns:
power (kW)

getPowerDownPowerRequired

public double getPowerDownPowerRequired()
Description copied from class: Function
Gets the amount of power required when function is at power down level.

Specified by:
getPowerDownPowerRequired in class Function
Returns:
power (kW)

timePassing

public void timePassing(double time)
Description copied from class: Function
Time passing for the building.

Specified by:
timePassing in class Function
Parameters:
time - amount of time passing (in millisols)

requiresManufacturingWork

public boolean requiresManufacturingWork(int skill)
Checks if manufacturing function currently requires manufacturing work.

Parameters:
skill - the person's materials science skill level.
Returns:
true if manufacturing work.

requiresSalvagingWork

public boolean requiresSalvagingWork(int skill)
Checks if manufacturing function currently requires salvaging work.

Parameters:
skill - the person's materials science skill level.
Returns:
true if manufacturing work.

endManufacturingProcess

public void endManufacturingProcess(ManufactureProcess process,
                                    boolean premature)
Ends a manufacturing process.

Parameters:
process - the process to end.
premature - true if the process has ended prematurely.
Throws:
BuildingException - if error ending process.

endSalvageProcess

public void endSalvageProcess(SalvageProcess process,
                              boolean premature)
Ends a salvage process.

Parameters:
process - the process to end.
premature - true if process is ended prematurely.
Throws:
BuildingException - if error ending process.

destroy

public void destroy()
Description copied from class: Function
Prepare object for garbage collection.

Overrides:
destroy in class Function


Copyright © 2009-2013. All Rights Reserved.