Skip to content

Instantly share code, notes, and snippets.

@volgar1x
Created October 30, 2012 16:41
Show Gist options
  • Save volgar1x/3981410 to your computer and use it in GitHub Desktop.
Save volgar1x/3981410 to your computer and use it in GitHub Desktop.
package org.shivas.data.converter;
import com.google.common.collect.Sets;
import junit.framework.TestCase;
import org.shivas.data.converter.loaders.AncestraLoader;
import org.shivas.data.converter.loaders.DataLoader;
import org.shivas.data.entity.SpellEffect;
import org.shivas.data.entity.SpellLevel;
import org.shivas.data.entity.SpellTemplate;
import java.util.Set;
import static org.shivas.common.collections.CollectionQuery.from;
/**
* Created with IntelliJ IDEA.
* User: Blackrush
* Date: 30/10/12
* Time: 17:34
*/
public class FuckingEffectDeMerde extends TestCase {
public void test1() throws Exception {
DataLoader loader = new AncestraLoader("localhost", "root", "", "ancestrar_static");
Set<Short> missingEffects = Sets.newHashSet();
for (SpellTemplate spell : loader.loadSpells().values()) {
if (spell == null) continue;
for (SpellLevel level : spell.getLevels()) {
if (level == null) continue;
for (SpellEffect effect : from(level.getEffects()).with(level.getCriticalEffects())) {
if (effect == null) continue;
if (effect.getType() == null) {
missingEffects.add(effect.getFirst());
}
}
}
}
for (Short effectId : missingEffects) {
System.out.format("Unknown_%d(%d),\n", effectId, effectId);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment