Add method to check whether attributes have been modified.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 18 Apr 2012 04:59:23 +0000 (06:59 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 18 Apr 2012 04:59:23 +0000 (06:59 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java

index 6a21081..a2c0f63 100644 (file)
@@ -47,6 +47,15 @@ public class AbstractBase {
                return (Value<T>) attributes.get(name);
        }
 
+       protected boolean dirty() {
+               for (Value<?> value : attributes.values()) {
+                       if (value.dirty()) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
        protected static class Value<T> {
 
                private T original;