@Test public void testType() throws Exception { final Character prototype = new Character(); prototype.set(Stats.ARMOR, 1); prototype.set(Stats.INTELLECT, 2); assertNull(prototype.type()); final Character stupid = new Character(Type.ROGUE, prototype); stupid.remove(Stats.INTELLECT); assertEquals(Type.ROGUE, stupid.type()); final Character weak = new Character("weak", prototype); weak.remove(Stats.ARMOR); assertNull(weak.type()); }
public Type type() { return type; }
Character implements Prototype { public Type type() { return type; } }
Character implements Prototype { public Type type() { return type; } Character();  Character(Type type, Prototype prototype);  Character(String name, Character prototype); }
Character implements Prototype { public Type type() { return type; } Character();  Character(Type type, Prototype prototype);  Character(String name, Character prototype); String name(); Type type(); @Override Integer get(Stats stat); @Override boolean has(Stats stat); @Override void set(Stats stat, Integer val); @Override void remove(Stats stat); @Override String toString(); }
Character implements Prototype { public Type type() { return type; } Character();  Character(Type type, Prototype prototype);  Character(String name, Character prototype); String name(); Type type(); @Override Integer get(Stats stat); @Override boolean has(Stats stat); @Override void set(Stats stat, Integer val); @Override void remove(Stats stat); @Override String toString();  }