public void setbardRitCast(Data bardritCast) {
   bardritCast.abilName = "Ritual Casting";
   bardritCast.dClass = "Bard";
   bardritCast.dlevel = 1;
   bardritCast.flavor =
       "You can cast any bard spell you know as a ritual if that spell has the ritual tag.";
 }
 public void setBarbarianUnarmor(Data barbarianUnarmor) {
   barbarianUnarmor.abilName = "Unarmored Defense";
   barbarianUnarmor.dlevel = 1;
   barbarianUnarmor.dClass = "Barbarian";
   barbarianUnarmor.flavor =
       "While you are not wearing any armor, your Armor Class equals 10 + your Dexterity modifier + your Constitution modifier. You can use a shield and still gain this benefit.\n";
 }
 public void setSorcSCFocus(Data sorcSCFocus) {
   sorcSCFocus.abilName = "Spellcasting Focus";
   sorcSCFocus.dlevel = 1;
   sorcSCFocus.dClass = "Sorcerer";
   sorcSCFocus.flavor =
       "You can use an arcane focus (found in chapter 5) as a spellcasting focus for your sorcerer spells.";
 }
 /** @deprecated using deprecated api */
 protected void store() {
   Data data = new Data();
   data.i_map = db().collections().newHashMap(10);
   setDefaultValues(data.i_map);
   data.i_helper = helper(10);
   store(data);
 }
 public void setFightStyleTWF(Data fightStyleTWF) {
   fightStyleTWF.abilName = "Fighting Style Two Weapon Fighting";
   fightStyleTWF.dlevel = 1;
   fightStyleTWF.dClass = "Fighter";
   fightStyleTWF.flavor =
       "When you engage in two-weapon fighting, you can add your ability modifier to the damage of the second attack.";
 }
 public void setWarlockSCFocus(Data warlockSCFocus) {
   warlockSCFocus.abilName = "Spellcasting Focus";
   warlockSCFocus.dlevel = 1;
   warlockSCFocus.dClass = "Warlock";
   warlockSCFocus.flavor =
       "You can use an arcane focus (found in chapter 5) as a spellcasting focus for your warlock spells.\n";
 }
 public void setWizardRitualCasting(Data wizardRitualCasting) {
   wizardRitualCasting.abilName = "Ritual Casting";
   wizardRitualCasting.dlevel = 1;
   wizardRitualCasting.dClass = "Wizard";
   wizardRitualCasting.flavor =
       "You can cast a wizard spell as a ritual if that spell has the ritual tag and you have the spell in your spellbook. You don't need to have the spell prepared.\n";
 }
 public void setDruidRitCast(Data druidRitCast) {
   druidRitCast.abilName = "Ritual Casting";
   druidRitCast.dClass = "Druid";
   druidRitCast.dlevel = 1;
   druidRitCast.flavor =
       "You can cast a druid spell as a ritual if that spell has the ritual tag and you have the spell prepared.";
 }
 public void setDruidCastFocus(Data druidCastFocus) {
   druidCastFocus.abilName = "Spellcasting Focus";
   druidCastFocus.dlevel = 1;
   druidCastFocus.dClass = "Druid";
   druidCastFocus.flavor =
       "You can use a druidic focus (found in chapter 5) as a spellcasting focus for your druid spells.";
 }
 public void setclericCastFocus(Data bardcastFocus) {
   bardcastFocus.abilName = "Spellcasting Focus";
   bardcastFocus.dlevel = 1;
   bardcastFocus.dClass = "Cleric";
   bardcastFocus.flavor =
       "You can use a holy symbol (found in chapter 5) as a spellcasting focus for your cleric spells.";
 }
 public void setDruidic(Data druidic) {
   druidic.abilName = "Druidic";
   druidic.dlevel = 1;
   druidic.dClass = "Druid";
   druidic.flavor =
       "You know Druidic, the secret language of druids. You can speak the language and use it to leave hidden messages. You and others who know this language automatically spot such a message. Others spot the message’s presence with a successful DC 15 Wisdom (Perception) check but can’t decipher it without magic.";
 }
 public void setclericRitCast(Data bardritCast) {
   bardritCast.abilName = "Ritual Casting";
   bardritCast.dClass = "Cleric";
   bardritCast.dlevel = 1;
   bardritCast.flavor =
       "You can cast a cleric spell as a ritual if that spell has the ritual tag and you have the spell prepared.";
 }
 public void setclericSCAbility(Data scAbility) {
   scAbility.abilName = "Spell Casting Ability";
   scAbility.dlevel = 1;
   scAbility.dClass = "Cleric";
   scAbility.flavor =
       "Wisdom is your spellcasting ability for your cleric spells. The power of your spells comes from your devotion to your deity. You use your Wisdom whenever a cleric spell refers to your spellcasting ability. In addition, you use your Wisdom modifier when setting the saving throw DC for a cleric spell you cast and when making an attack roll with one.";
 }
 public void setbardCastFocus(Data bardcastFocus) {
   bardcastFocus.abilName = "Spellcasting Focus";
   bardcastFocus.dlevel = 1;
   bardcastFocus.dClass = "Bard";
   bardcastFocus.flavor =
       "You can use a musical instrument (found in chapter 5) as a spellcasting focus for your bard spells.";
 }
 public void setSorcDraconicResilience(Data sorcDraconicResilience) {
   sorcDraconicResilience.abilName = "Draconic Resistance";
   sorcDraconicResilience.dlevel = 1;
   sorcDraconicResilience.dClass = "Sorcerer";
   sorcDraconicResilience.flavor =
       "At 1st level, you choose one type of dragon as your ancestor. The damage type associated with each dragon is used by features you gain later. You can speak, read, and write Draconic. Additionally, whenever you make a Charisma check when interacting with dragons, your proficiency bonus is doubled if it applies to the check.";
 }
 public void setFightStyleDueling(Data fightStyleDueling) {
   fightStyleDueling.abilName = "Fighting Style Dueling";
   fightStyleDueling.dlevel = 1;
   fightStyleDueling.dClass = "Fighter";
   fightStyleDueling.flavor =
       "When you are wielding a melee weapon in one hand and no other weapons, you gain a +2 bonus to damage rolls with that weapon.";
 }
 public void setWarlockSCAbility(Data warlockSCAbility) {
   warlockSCAbility.abilName = "Spellcasting Ability";
   warlockSCAbility.dlevel = 1;
   warlockSCAbility.dClass = "Warlock";
   warlockSCAbility.flavor =
       "Charisma is your spellcasting ability for your warlock spells, so you use your Charisma whenever a spell refers to your spellcasting ability. In addition, you use your Charisma modifier when setting the saving throw DC for a warlock spell you cast and when making an attack roll with one.\n";
 }
 public void setFightStyleGWF(Data fightStyleGWF) {
   fightStyleGWF.abilName = "Fighting Style Great Weapon Fighter";
   fightStyleGWF.dlevel = 1;
   fightStyleGWF.dClass = "Fighter";
   fightStyleGWF.flavor =
       "When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can reroll the die and must use the new roll, even if the new roll is a 1 or a 2. The weapon must have the two-handed or versatile property for you to gain this benefit.";
 }
 public void setWizardSpellbook(Data wizardSpellbook) {
   wizardSpellbook.abilName = "Spellbook";
   wizardSpellbook.dlevel = 1;
   wizardSpellbook.dClass = "Wizard";
   wizardSpellbook.flavor =
       "At 1st level, you have a spellbook containing six 1st-level wizard spells of your choice.";
 }
 public void setFightStyleProtection(Data fightStyleProtection) {
   fightStyleProtection.abilName = "Fighting Style Protection";
   fightStyleProtection.dlevel = 1;
   fightStyleProtection.dClass = "Fighter";
   fightStyleProtection.flavor =
       "When a creature you can see attacks a target other than you that is within 5 feet of you, you can use your reaction to impose disadvantage on the attack roll. You must be wielding a shield.";
 }
 private void restoreMembers(Data data) {
   Query q = newQuery(Data.class);
   ObjectSet objectSet = q.execute();
   Data rdata = (Data) objectSet.next();
   data.i_map = rdata.i_map;
   data.i_helper = rdata.i_helper;
 }
 public void setSorcSCAbility(Data sorcSCAbility) {
   sorcSCAbility.abilName = "Spellcasting Ability";
   sorcSCAbility.dlevel = 1;
   sorcSCAbility.dClass = "Sorcerer";
   sorcSCAbility.flavor =
       "Charisma is your spellcasting ability for your sorcerer spells, since the power of your magic relies on your ability to project your will into the world. You use your Charisma whenever a spell refers to your spellcasting ability. In addition, you use your Charisma modifier when setting the saving throw DC for a sorcerer spell you cast and when making an attack roll with one.";
 }
 public void writeExternal(final Element element) throws WriteExternalException {
   super.writeExternal(element);
   JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
   writeModule(element);
   DefaultJDOMExternalizer.writeExternal(this, element);
   final Data persistentData = getPersistentData();
   DefaultJDOMExternalizer.writeExternal(persistentData, element);
   EnvironmentVariablesComponent.writeExternal(element, persistentData.getEnvs());
   final String dirName = persistentData.getDirName();
   if (!dirName.isEmpty()) {
     final Element dirNameElement = new Element("dir");
     dirNameElement.setAttribute("value", FileUtil.toSystemIndependentName(dirName));
     element.addContent(dirNameElement);
   }
   final Element patternsElement = new Element(PATTERNS_EL_NAME);
   for (String o : persistentData.getPatterns()) {
     final Element patternElement = new Element(PATTERN_EL_NAME);
     patternElement.setAttribute(TEST_CLASS_ATT_NAME, o);
     patternsElement.addContent(patternElement);
   }
   final String forkMode = getForkMode();
   if (!forkMode.equals("none")) {
     final Element forkModeElement = new Element("fork_mode");
     forkModeElement.setAttribute("value", forkMode);
     element.addContent(forkModeElement);
   }
   element.addContent(patternsElement);
   PathMacroManager.getInstance(getProject()).collapsePathsRecursively(element);
 }
Example #24
0
 /** Test of initialize method, of class Activity. */
 @Test
 public void testInitialize_Activity_Map() throws Exception {
   System.out.println("initialize");
   // Setup
   ParentActivity parent = new ParentActivity();
   Data data = new Data();
   Map<Field, Object> fieldParams = new HashMap<Field, Object>();
   for (Field field : data.getClass().getDeclaredFields()) {
     field.setAccessible(true);
     fieldParams.put(field, field.get(data));
   }
   final String field2 = "field2value";
   final List<String> field3 = new ArrayList<String>();
   Map<String, Object> takeoverParams =
       new HashMap<String, Object>() {
         {
           put("field2", field2);
           put("field3", field3);
         }
       };
   ChildActivity child = new ChildActivity();
   child.initialize(parent, fieldParams, takeoverParams);
   // Assertion
   assertEquals(parent, child.getParent());
   assertEquals(data.getField0(), child.field0);
   assertEquals(data.getField1(), child.field1);
   assertEquals(field2, child.field2);
   assertEquals(field3, child.field3);
   assertEquals("TESTING", child.getTest());
 }
  public <T> T toObject(final Object object) {
    if (!(object instanceof Data)) {
      return (T) object;
    }

    Data data = (Data) object;

    if (data.bufferSize() == 0 && data.isDataSerializable()) {
      return null;
    }
    try {
      final int typeId = data.type;
      final SerializerAdapter serializer = serializerFor(typeId);
      if (serializer == null) {
        if (active) {
          throw new HazelcastSerializationException(
              "There is no suitable de-serializer for type " + typeId);
        }
        throw new HazelcastInstanceNotActiveException();
      }
      if (typeId == SerializationConstants.CONSTANT_TYPE_PORTABLE) {
        serializationContext.registerClassDefinition(data.classDefinition);
      }
      Object obj = serializer.read(data);
      if (managedContext != null) {
        obj = managedContext.initialize(obj);
      }
      return (T) obj;
    } catch (Throwable e) {
      handleException(e);
    }
    return null;
  }
Example #26
0
 /** Test of renderChildren method, of class Activity. */
 @Test
 public void testCreateChildren() throws Exception {
   System.out.println("renderChildren");
   // Setup
   ChildPane childPane = new ChildPane();
   childPane.setChild("Child");
   VBox vbox = VBoxBuilder.create().children(childPane).build();
   Parent parent = new Parent();
   parent.setScene(vbox);
   Data data = new Data();
   Map<Field, Object> fieldParams = new HashMap<Field, Object>();
   for (Field field : data.getClass().getDeclaredFields()) {
     field.setAccessible(true);
     fieldParams.put(field, field.get(data));
   }
   RenderParameter renderParam = new RenderParameter();
   String id = renderParam.putParam("checkForLabel", "CheckForLabel");
   childPane.setId(id);
   parent.createChildren(fieldParams, renderParam, ValidationResult.getEmptyResult());
   // Assertoin
   Child child = (Child) parent.getChildActivities(Child.class).get(0);
   assertNotNull(child);
   assertNotNull(child.getScene());
   assertEquals(childPane, child.getScene());
   assertEquals(parent, child.getParent());
   VBox cvbox = (VBox) child.getScene().getChildren().get(0);
   assertTrue(cvbox.getChildren().get(0) instanceof Button);
   assertTrue(cvbox.getChildren().get(1) instanceof Label);
   assertEquals(data.checkForButton, ((Button) cvbox.getChildren().get(0)).getText());
   assertEquals("CheckForLabel", ((Label) cvbox.getChildren().get(1)).getText());
 }
Example #27
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }

    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    Data<Resource> that = ((Relationship) o).getData();

    if (that == null || data == null) {
      return that == data;
    }

    Collection<ResourceIdentifier> resourceIdentifiers = data.toResourceIdentifiers();
    Collection<ResourceIdentifier> theirIdentifiers = that.toResourceIdentifiers();

    for (ResourceIdentifier resourceIdentifier : resourceIdentifiers) {
      if (!theirIdentifiers.contains(resourceIdentifier)) {
        return false;
      }
    }
    return true;
  }
 public void bePatternConfiguration(List<PsiClass> classes, PsiMethod method) {
   myData.TEST_OBJECT = TEST_PATTERN;
   final Set<String> patterns = new HashSet<String>();
   final String methodSufiix;
   if (method != null) {
     myData.METHOD_NAME = method.getName();
     methodSufiix = "," + myData.METHOD_NAME;
   } else {
     methodSufiix = "";
   }
   for (PsiClass pattern : classes) {
     patterns.add(JavaExecutionUtil.getRuntimeQualifiedName(pattern) + methodSufiix);
   }
   myData.setPatterns(patterns);
   final Module module =
       PatternConfigurationProducer.findModule(
           this, getConfigurationModule().getModule(), patterns);
   if (module == null) {
     myData.setScope(TestSearchScope.WHOLE_PROJECT);
     setModule(null);
   } else {
     setModule(module);
   }
   setGeneratedName();
 }
Example #29
0
 public synchronized Object rdp(Object key) {
   Object obj = null;
   Data data = (Data) map.get(key);
   if (data != null) {
     return data.get(key);
   }
   return obj;
 }
Example #30
0
 /**
  * Calculates the new distance value for the given node.
  *
  * @param preAfter the current PRE value of the node (after structural updates have been applied)
  * @return new distance for the given node
  */
 private int calculateNewDistance(final int preAfter) {
   final int kind = data.kind(preAfter);
   final int distanceBefore = data.dist(preAfter, kind);
   final int preBefore = calculatePreValue(preAfter, true);
   final int parentBefore = preBefore - distanceBefore;
   final int parentAfter = calculatePreValue(parentBefore, false);
   return preAfter - parentAfter;
 }