From 3cdc5b968a59fd6bc701adda2a3d859eb2dcce47 Mon Sep 17 00:00:00 2001 From: melvin Date: Fri, 1 Jul 2011 11:33:59 +0800 Subject: [PATCH] added getId --- src/magic/model/choice/MagicExcludeResult.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/magic/model/choice/MagicExcludeResult.java b/src/magic/model/choice/MagicExcludeResult.java index f8e4c0d956..a6fd38a6fe 100644 --- a/src/magic/model/choice/MagicExcludeResult.java +++ b/src/magic/model/choice/MagicExcludeResult.java @@ -57,4 +57,16 @@ public class MagicExcludeResult implements MagicMappable { } return buffer.toString(); } + + @Override + public long getId() { + int idx = 0; + long[] input = new long[excludePermanents.size() + 1]; + for (final MagicPermanent permanent : excludePermanents) { + input[idx] = permanent.getId(); + idx++; + } + input[input.length - 1] = excludeFlags; + return magic.MurmurHash3.hash(input); + } }