Skip to content

Commit

Permalink
Pass simulate to CastingEnvironmentComponent.ExtractMedia
Browse files Browse the repository at this point in the history
  • Loading branch information
vgskye committed Nov 12, 2024
1 parent 8a71cb5 commit b3a25aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ public boolean isEnlightened() {
*/
public long extractMedia(long cost, boolean simulate) {
for (var extractMediaComponent : preMediaExtract)
cost = extractMediaComponent.onExtractMedia(cost);
cost = extractMediaComponent.onExtractMedia(cost, simulate);
cost = extractMediaEnvironment(cost, simulate);
for (var extractMediaComponent : postMediaExtract)
cost = extractMediaComponent.onExtractMedia(cost);
cost = extractMediaComponent.onExtractMedia(cost, simulate);
return cost;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ interface ExtractMedia extends CastingEnvironmentComponent {
* remaining cost after deducting whatever cost source this component
* is responsible for (should be >= 0)
*/
long onExtractMedia(long cost);
long onExtractMedia(long cost, boolean simulate);

/**
* ExtractMedia component that extracts media BEFORE the call to {@link CastingEnvironment#extractMediaEnvironment(long)}
* ExtractMedia component that extracts media BEFORE the call to {@link CastingEnvironment#extractMediaEnvironment(long, boolean)}
*/
interface Pre extends ExtractMedia {}

/**
* ExtractMedia component that extracts media AFTER the call to {@link CastingEnvironment#extractMediaEnvironment(long)}
* ExtractMedia component that extracts media AFTER the call to {@link CastingEnvironment#extractMediaEnvironment(long, boolean)}
* if the input is <= 0 you should also probably return 0 (since media cost was already paid off)
*/
interface Post extends ExtractMedia {}
Expand Down

0 comments on commit b3a25aa

Please sign in to comment.