From: David ‘Bombe’ Roden Date: Wed, 18 Apr 2012 04:59:23 +0000 (+0200) Subject: Add method to check whether attributes have been modified. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1cefd03b611b9c5b9ee3ac0690a941a04eb6b1a4;p=demoscenemusic.git Add method to check whether attributes have been modified. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java index 6a21081..a2c0f63 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java @@ -47,6 +47,15 @@ public class AbstractBase { return (Value) attributes.get(name); } + protected boolean dirty() { + for (Value value : attributes.values()) { + if (value.dirty()) { + return true; + } + } + return false; + } + protected static class Value { private T original;