de.upb.swtpra05.group03.shuttle
Class ShuttleData

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.ShuttleData
All Implemented Interfaces:
Module, ShuttleDataInterface, ShuttleModule

public class ShuttleData
extends java.lang.Object
implements ShuttleModule, ShuttleDataInterface

The shuttle data.

Version:
$Revision: 1.3 $

Field Summary
private  int currentStationId
          The station id where the shuttle is currently on
private  int currentStretch
          The current stretch the shuttle moved
private  int loadTime
          The time needed for loading the shuttle
private  int maxAllowedStretchLimit
          The maximum allowed stretch the shuttle can drive
private  int maxCapacity
          The maximum capacity of the shuttle
private  int parkingFeeAmount
          the parking fee if parking at a station
private  int parkingFeeFrequency
          The frequency how often the parkingFeeAmount has to be payed
private  int postalChargingAmount
          the costs for a message
private  int previousStationId
          The station id where the shuttle was previously
private  int repairCosts
          The amount of money payed for any repair
private  int repairTime
          The time needed for repairing the shuttle
private  int unloadTime
          The time needed for unloading the shuttle
 
Constructor Summary
ShuttleData()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
private  void gameConstants(de.upb.swtpra.kernel.message.GameConstantsMessage msg)
          Sets the game constants.
 int getCurrentStationId()
           
 int getCurrentStretch()
           
 int getLoadTime()
           
 int getMaxAllowedStretchLimit()
           
 int getMaxCapacity()
           
 int getParkingFeeAmount()
           
 int getParkingFeeFrequency()
           
 int getPostalChargingAmount()
           
 int getPreviousStationId()
           
 int getRepairCosts()
           
 int getRepairTime()
           
 int getUnloadTime()
           
 void init(ModuleContainerInterface manager)
          Initializes this module.
 void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
          React on the received message of the shuttle or not.
 void setCurrentStationId(int i)
           
 void setCurrentStretch(int i)
           
 void setPreviousStationId(int i)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxAllowedStretchLimit

private int maxAllowedStretchLimit
The maximum allowed stretch the shuttle can drive


unloadTime

private int unloadTime
The time needed for unloading the shuttle


loadTime

private int loadTime
The time needed for loading the shuttle


repairTime

private int repairTime
The time needed for repairing the shuttle


repairCosts

private int repairCosts
The amount of money payed for any repair


maxCapacity

private int maxCapacity
The maximum capacity of the shuttle


currentStretch

private int currentStretch
The current stretch the shuttle moved


currentStationId

private int currentStationId
The station id where the shuttle is currently on


previousStationId

private int previousStationId
The station id where the shuttle was previously


parkingFeeFrequency

private int parkingFeeFrequency
The frequency how often the parkingFeeAmount has to be payed


parkingFeeAmount

private int parkingFeeAmount
the parking fee if parking at a station


postalChargingAmount

private int postalChargingAmount
the costs for a message

Constructor Detail

ShuttleData

public ShuttleData()
Method Detail

init

public void init(ModuleContainerInterface manager)
Description copied from interface: Module
Initializes this module. References to other modules should be set here to avoid circle dependencies.

Specified by:
init in interface Module
Parameters:
manager - The module manager which contain all modules

newMessageReceived

public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: ShuttleModule
React on the received message of the shuttle or not.

Specified by:
newMessageReceived in interface ShuttleModule
Parameters:
msg - The received message of the shuttle

gameConstants

private void gameConstants(de.upb.swtpra.kernel.message.GameConstantsMessage msg)
Sets the game constants.

Parameters:
msg - The GameConstantsMessage

getCurrentStretch

public int getCurrentStretch()
Specified by:
getCurrentStretch in interface ShuttleDataInterface
Returns:
current stretch

getLoadTime

public int getLoadTime()
Specified by:
getLoadTime in interface ShuttleDataInterface
Returns:
load time

getMaxAllowedStretchLimit

public int getMaxAllowedStretchLimit()
Specified by:
getMaxAllowedStretchLimit in interface ShuttleDataInterface
Returns:
max allowed stretch

getMaxCapacity

public int getMaxCapacity()
Specified by:
getMaxCapacity in interface ShuttleDataInterface
Returns:
max capacity

getRepairCosts

public int getRepairCosts()
Specified by:
getRepairCosts in interface ShuttleDataInterface
Returns:
repair costs

getRepairTime

public int getRepairTime()
Specified by:
getRepairTime in interface ShuttleDataInterface
Returns:
repair time

getUnloadTime

public int getUnloadTime()
Specified by:
getUnloadTime in interface ShuttleDataInterface
Returns:
unload time

setCurrentStretch

public void setCurrentStretch(int i)
Specified by:
setCurrentStretch in interface ShuttleDataInterface
Parameters:
i -

getCurrentStationId

public int getCurrentStationId()
Specified by:
getCurrentStationId in interface ShuttleDataInterface
Returns:
current station id

getPreviousStationId

public int getPreviousStationId()
Specified by:
getPreviousStationId in interface ShuttleDataInterface
Returns:
previous station id

setCurrentStationId

public void setCurrentStationId(int i)
Specified by:
setCurrentStationId in interface ShuttleDataInterface
Parameters:
i -

setPreviousStationId

public void setPreviousStationId(int i)
Specified by:
setPreviousStationId in interface ShuttleDataInterface
Parameters:
i -

getParkingFeeAmount

public int getParkingFeeAmount()
Specified by:
getParkingFeeAmount in interface ShuttleDataInterface
Returns:
parginfeeamount

getParkingFeeFrequency

public int getParkingFeeFrequency()
Specified by:
getParkingFeeFrequency in interface ShuttleDataInterface
Returns:
parkingFeeFrequency

getPostalChargingAmount

public int getPostalChargingAmount()
Specified by:
getPostalChargingAmount in interface ShuttleDataInterface
Returns:
postalChargingAmount

equals

public boolean equals(java.lang.Object obj)