Commit 70bb682b authored by Julian Zobel's avatar Julian Zobel 🦄
Browse files

More on multi-resource support

parent 153cc3c2
......@@ -2,7 +2,7 @@ package de.tudarmstadt.maki.simonstrator.api.component.resourcedistribution.anal
import de.tudarmstadt.maki.simonstrator.api.common.UniqueID;
import de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent;
import de.tudarmstadt.maki.simonstrator.api.component.resourcedistribution.DistributableResource;
import de.tudarmstadt.maki.simonstrator.api.component.resourcedistribution.DistributableResource.RESOURCE_TYPE;
import de.tudarmstadt.maki.simonstrator.api.component.resourcedistribution.DistributableResourceInventory;
/**
......@@ -19,14 +19,13 @@ public interface ResourceDistributionAnalyzer extends MonitorComponent.Analyzer
* Implementors: Keep track of this value and decrease when {@link #resourceAmountChanged(UniqueID, int, int)}
* indicates a fill up of resources to find the moment when no more resources are available.
*/
void addMaxResources(DistributableResource.RESOURCE_TYPE resourceType, int resourceAmount);
void addMaxResources(RESOURCE_TYPE resourceType, double resourceAmount);
/**
* Must be called if a distributor is removed from the field while still holding resources, and these resources
* were added back to the global pool of distributable resources.
*/
void restoreMaxResources(UniqueID beaconID, DistributableResource.RESOURCE_TYPE resourceType,
double resourceAmount);
void restoreMaxResources(UniqueID beaconID, double resourceAmount);
/**
* Called when the amount of resources at the given beacon changes. What caused the change depends on the number
......@@ -37,8 +36,7 @@ public interface ResourceDistributionAnalyzer extends MonitorComponent.Analyzer
* 0 as oldResources. The total amount of resources distributed may not exceed the maximum value indicated by
* {@link #addMaxResources(short, int)}.
*/
void resourceAmountChanged(UniqueID beaconID, double oldResources, double newResources,
DistributableResource.RESOURCE_TYPE resourceType);
void resourceAmountChanged(UniqueID beaconID, double oldResources, double newResources);
void initalResources(UniqueID beaconID, DistributableResourceInventory resourceInventory);
void initalResources(UniqueID beaconID, DistributableResourceInventory resources);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment