rails.algorithms
Class RevenueManager

java.lang.Object
  extended by rails.algorithms.RevenueManager
All Implemented Interfaces:
ConfigurableComponentI

public final class RevenueManager
extends java.lang.Object
implements ConfigurableComponentI

Coordinates and stores all elements related to revenue calulcation, which are permanent. The conversion of Rails elements is in the responsibility of the RevenueAdapter. For each GameManager instance only one RevenueManager is created.

Author:
freystef

Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
RevenueManager()
           
 
Method Summary
 void addDynamicModifier(RevenueDynamicModifier modifier)
           
 void addGraphModifier(NetworkGraphModifier modifier)
           
 void addStaticModifier(RevenueStaticModifier modifier)
           
(package private)  java.util.List<RevenueDynamicModifier> callDynamicModifiers(RevenueAdapter revenueAdapter)
           
(package private)  void callGraphModifiers(NetworkGraphBuilder graphBuilder)
           
(package private)  void callStaticModifiers(RevenueAdapter revenueAdapter)
           
 void configureFromXML(Tag tag)
          Instructs the component to configure itself from the provided XML element.
 void finishConfiguration(GameManagerI parent)
          This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first.
 boolean removeDynamicModifier(RevenueDynamicModifier modifier)
           
 boolean removeGraphModifier(NetworkGraphModifier modifier)
           
 boolean removeStaticModifier(RevenueStaticModifier modifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
Constructor Detail

RevenueManager

public RevenueManager()
Method Detail

configureFromXML

public void configureFromXML(Tag tag)
                      throws ConfigurationException
Description copied from interface: ConfigurableComponentI
Instructs the component to configure itself from the provided XML element.

Specified by:
configureFromXML in interface ConfigurableComponentI
Throws:
ConfigurationException

finishConfiguration

public void finishConfiguration(GameManagerI parent)
                         throws ConfigurationException
Description copied from interface: ConfigurableComponentI
This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first. This includes creating any required relationships to other configured components and objects.

This method should be called where necessary after all XML file parsing has completed, so that all objects that need to be related to do exist.

Specified by:
finishConfiguration in interface ConfigurableComponentI
Parameters:
parent - The 'parent' configurable component is passed to allow the 'child' to access any other object without the need to resort to static calls where possible.
Throws:
ConfigurationException

addStaticModifier

public void addStaticModifier(RevenueStaticModifier modifier)

removeStaticModifier

public boolean removeStaticModifier(RevenueStaticModifier modifier)

addGraphModifier

public void addGraphModifier(NetworkGraphModifier modifier)

removeGraphModifier

public boolean removeGraphModifier(NetworkGraphModifier modifier)

addDynamicModifier

public void addDynamicModifier(RevenueDynamicModifier modifier)

removeDynamicModifier

public boolean removeDynamicModifier(RevenueDynamicModifier modifier)

callGraphModifiers

void callGraphModifiers(NetworkGraphBuilder graphBuilder)

callStaticModifiers

void callStaticModifiers(RevenueAdapter revenueAdapter)

callDynamicModifiers

java.util.List<RevenueDynamicModifier> callDynamicModifiers(RevenueAdapter revenueAdapter)