From: David ‘Bombe’ Roden Date: Fri, 1 Mar 2013 06:21:44 +0000 (+0100) Subject: Store the latest comic state. X-Git-Tag: v2~304 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bb0b1b5bba9061e6a01cb4e1a42b261cc833a731;p=rhynodge.git Store the latest comic state. --- diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewComicTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewComicTrigger.java index 1b64c5b..fa3347c 100644 --- a/src/main/java/net/pterodactylus/rhynodge/triggers/NewComicTrigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/triggers/NewComicTrigger.java @@ -45,6 +45,9 @@ public class NewComicTrigger implements Trigger { /** The new comics. */ private final List newComics = Lists.newArrayList(); + /** The latest comic state. */ + private ComicState mergedComicState; + @Override public State mergeStates(State previousState, State currentState) { checkArgument(previousState instanceof ComicState, "previous state must be a comic state"); @@ -54,7 +57,7 @@ public class NewComicTrigger implements Trigger { ComicState currentComicState = (ComicState) currentState; /* copy old state into new state. */ - ComicState mergedComicState = new ComicState(); + mergedComicState = new ComicState(); for (Comic comic : previousComicState) { mergedComicState.add(comic); }