浏览代码

Fixing build errors from merge

Sam Jaffe 8 年之前
父节点
当前提交
318312a1d4
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/main/lombok/org/leumasjaffe/charsheet/model/features/impl/Skill.java

+ 6 - 3
src/main/lombok/org/leumasjaffe/charsheet/model/features/impl/Skill.java

@@ -40,15 +40,18 @@ public class Skill implements DDProperty, DDPropertyChooser {
 	@Override
 	public boolean applySideEffects(DDCharacter to, DDCharacterClass toClass, int selectedIndex) {
 		toClass.addFeature(get(selectedIndex));
-		ObserverDispatch.notifySubscribers(to.getSkills());
-		to.getSkills().getSkill(getName()).ifPresent(ObserverDispatch::notifySubscribers);
+		doNotify(to);
 		return true;
 	}
 	
 	@Override
 	public void undoSideEffects(DDCharacter to, DDCharacterClass toClass, int selectedIndex) {
 		toClass.removeFeature(get(selectedIndex));
+		doNotify(to);
+	}
+
+	private void doNotify(DDCharacter to) {
 		ObserverDispatch.notifySubscribers(to.getSkills());
-		to.getSkills().getSkill(getName()).ifPresent(ObserverDispatch::notifySubscribers);
+		ObserverDispatch.notifySubscribers(to.getSkills().getSkill(getName()));
 	}
 }